001/**
002 * Copyright 2014 The Sculptor Project Team, including the original
003 * author or authors.
004 * 
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 * 
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 * 
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.sculptor.generator.cartridge.builder;
018
019import javax.inject.Inject;
020import javax.inject.Named;
021import org.eclipse.xtext.xbase.lib.Extension;
022import org.sculptor.generator.chain.ChainLink;
023import org.sculptor.generator.chain.ChainOverridable;
024import org.sculptor.generator.configuration.MutableConfigurationProvider;
025import org.sculptor.generator.util.PropertiesBase;
026
027@ChainOverridable
028@SuppressWarnings("all")
029public class BuilderProperties extends ChainLink<BuilderProperties> {
030  @Inject
031  @Extension
032  private PropertiesBase propertiesBase;
033  
034  /**
035   * Prepare the default values with values inherited from the configuration.
036   */
037  @Inject
038  protected void initDerivedDefaults(@Named("Mutable Defaults") final MutableConfigurationProvider defaultConfiguration) {
039    defaultConfiguration.setString("package.builder", "domain");
040    defaultConfiguration.setBoolean("generate.domainObject.builder", true);
041  }
042  
043  public String getBuilderPackage() {
044    return this.propertiesBase.getProperty("package.builder");
045  }
046  
047  public boolean isBuilderToBeGenerated() {
048    return this.propertiesBase.getBooleanProperty("generate.domainObject.builder");
049  }
050  
051  public BuilderProperties(final BuilderProperties next) {
052    super(next);
053  }
054  
055  public BuilderProperties[] _getOverridesDispatchArray() {
056    org.sculptor.generator.cartridge.builder.BuilderProperties[] result = new org.sculptor.generator.cartridge.builder.BuilderProperties[org.sculptor.generator.cartridge.builder.BuilderPropertiesMethodIndexes.NUM_METHODS];
057    return result;
058  }
059}