Class ClassBuilderConfigurator
-
- All Implemented Interfaces:
public final class ClassBuilderConfigurator<M extends Object>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ClassBuilderConfigurator.Setter
-
Field Summary
Fields Modifier and Type Field Description private final ClassNameBuilder<M>
className
private final PackageNameBuilder<M>
packageName
private String
projectDir
private String
projectSubDir
private Object
registerAsTypeOfCode
private final List<IClassCmBuilder<?>>
builders
private TemplateGenerator
template
private final List<Object>
dependencies
private final String
baseDir
private String
freemarkerTemplate
private final TypeOfCode<M>
typeOfCode
private final CodegenParams
params
private final DataTypeMapper
dataTypeMapper
private Boolean
forceGeneration
-
Constructor Summary
Constructors Constructor Description ClassBuilderConfigurator(TypeOfCode<M> typeOfCode, CodegenParams params, DataTypeMapper dataTypeMapper, Boolean forceGeneration)
-
Method Summary
-
-
Constructor Detail
-
ClassBuilderConfigurator
ClassBuilderConfigurator(TypeOfCode<M> typeOfCode, CodegenParams params, DataTypeMapper dataTypeMapper, Boolean forceGeneration)
-
-
Method Detail
-
getClassName
final ClassNameBuilder<M> getClassName()
-
getPackageName
final PackageNameBuilder<M> getPackageName()
-
getProjectDir
final String getProjectDir()
-
setProjectDir
final Unit setProjectDir(String projectDir)
-
getProjectSubDir
final String getProjectSubDir()
-
setProjectSubDir
final Unit setProjectSubDir(String projectSubDir)
-
getRegisterAsTypeOfCode
final Object getRegisterAsTypeOfCode()
Lets you register as a different type of code in the class index. For example, an ENUM type can be registered as DTO, which can simplify code model building implementations. In particular, that the ENUM can be regarded as a special case of the DTO.
-
setRegisterAsTypeOfCode
final Unit setRegisterAsTypeOfCode(Object registerAsTypeOfCode)
Lets you register as a different type of code in the class index. For example, an ENUM type can be registered as DTO, which can simplify code model building implementations. In particular, that the ENUM can be regarded as a special case of the DTO.
-
getBuilders
final List<IClassCmBuilder<?>> getBuilders()
-
getTemplate
final TemplateGenerator getTemplate()
-
setTemplate
final Unit setTemplate(TemplateGenerator template)
-
getDependencies
final List<Object> getDependencies()
-
getBaseDir
final String getBaseDir()
-
getFreemarkerTemplate
final String getFreemarkerTemplate()
Use FreeMarker template as generator.
The template should be located in classpath.
If you require some custom FreeMarker configuration pass into template own instance of FreeMarkerGeneratorFactory. Then you should also set the className.
-
setFreemarkerTemplate
final Unit setFreemarkerTemplate(String freemarkerTemplate)
-
getTypeOfCode
final TypeOfCode<M> getTypeOfCode()
-
getParams
final CodegenParams getParams()
-
getDataTypeMapper
final DataTypeMapper getDataTypeMapper()
-
getForceGeneration
final Boolean getForceGeneration()
-
setForceGeneration
final Unit setForceGeneration(Boolean forceGeneration)
-
addBuilder
final ClassBuilderConfigurator<M> addBuilder(IClassCmBuilder<out M> builders)
-
onDeclaration
final ClassBuilderConfigurator<M> onDeclaration(ClassCmBuilderTemplate.Builder<M> declarer)
-
onImplementation
final ClassBuilderConfigurator<M> onImplementation(ClassCmBuilderTemplate.Builder<M> implementer)
-
onDecoration
final ClassBuilderConfigurator<M> onDecoration(ClassCmBuilderTemplate.Builder<M> decorator)
-
registerAsTypeOfCode
final ClassBuilderConfigurator<M> registerAsTypeOfCode(Object typeOfCode)
-
projectSubDir
final ClassBuilderConfigurator<M> projectSubDir(String projectSubDir)
-
className
final ClassBuilderConfigurator<M> className(ClassNameBuilder.Setter<M> builder)
-
packageName
final ClassBuilderConfigurator<M> packageName(PackageNameBuilder.Setter<M> builder)
-
forceGeneration
final ClassBuilderConfigurator<M> forceGeneration(Boolean forceGeneration)
Forces code generation even if it is not used by other generated code.
-
freemarkerTemplate
final ClassBuilderConfigurator<M> freemarkerTemplate(Function0<String> templateProvider)
-
addManagedComponentBuilder
final ClassBuilderConfigurator<M> addManagedComponentBuilder()
Adds JavaParams.managedComponentBuilder and JavaParams.dependencyInjectionBuilder builders.
Note that if another builders adds an alternative annotation to the one provided by JavaParams.managedComponentBuilder, you should use the addDependencyInjectionBuilder method to provide dependency injection.
-
addDependencyInjectionBuilder
final ClassBuilderConfigurator<M> addDependencyInjectionBuilder()
Adds JavaParams.dependencyInjectionBuilder builder.
-
setup
final ClassBuilderConfigurator<M> setup(ClassBuilderConfigurator.Setter<M> setter)
-
-
-
-