Class JavaParams
-
- All Implemented Interfaces:
public final class JavaParamsRepresentation of a set of parameters allowing the parameterization (in selected aspects) of the java code generator.
-
-
Field Summary
Fields Modifier and Type Field Description private JavaNameMappernameMapperprivate IClassCmBuilder<Void>dependencyInjectionBuilderprivate IClassCmBuilder<Void>managedComponentBuilderprivate BooleanisAlwaysGenerateEnumFromValueMethodprivate IntegerjavaVersionprivate StringgeneratedAnnotationClassprivate StringgeneratedAnnotationValueprivate AnnotationCmgeneratedAnnotationprivate IClassCmBuilder<Void>generatedMarkBuilderprivate final List<CodeDecorator>codeDecoratorsprivate StringlicenceHeader
-
Constructor Summary
Constructors Constructor Description JavaParams()
-
Method Summary
Modifier and Type Method Description final JavaNameMappergetNameMapper()Name mapper from model to java. final UnitsetNameMapper(JavaNameMapper nameMapper)Name mapper from model to java. final IClassCmBuilder<Void>getDependencyInjectionBuilder()Builder for dependency injection code. final UnitsetDependencyInjectionBuilder(IClassCmBuilder<Void> dependencyInjectionBuilder)Builder for dependency injection code. final IClassCmBuilder<Void>getManagedComponentBuilder()Builder for managed components used by dependency injection framework. final UnitsetManagedComponentBuilder(IClassCmBuilder<Void> managedComponentBuilder)Builder for managed components used by dependency injection framework. final BooleanisAlwaysGenerateEnumFromValueMethod()It allows to force generation of the 'fromValue' method for enums. final UnitsetAlwaysGenerateEnumFromValueMethod(Boolean isAlwaysGenerateEnumFromValueMethod)It allows to force generation of the 'fromValue' method for enums. final IntegergetJavaVersion()final UnitsetJavaVersion(Integer javaVersion)final StringgetGeneratedAnnotationClass()Specify annotation class used to marking generated classes. final UnitsetGeneratedAnnotationClass(String generatedAnnotationClass)Specify annotation class used to marking generated classes. final StringgetGeneratedAnnotationValue()Specify annotation value used to marking generated classes. final UnitsetGeneratedAnnotationValue(String generatedAnnotationValue)Specify annotation value used to marking generated classes. final AnnotationCmgetGeneratedAnnotation()Specify annotation used to marking generated classes. final UnitsetGeneratedAnnotation(AnnotationCm generatedAnnotation)Specify annotation used to marking generated classes. final IClassCmBuilder<Void>getGeneratedMarkBuilder()Using this parameter you will be able to specify build strategy, which will be applied to every class generation. final UnitsetGeneratedMarkBuilder(IClassCmBuilder<Void> generatedMarkBuilder)Using this parameter you will be able to specify build strategy, which will be applied to every class generation. final List<CodeDecorator>getCodeDecorators()Code contents decorators. final StringgetLicenceHeader()final UnitsetLicenceHeader(String licenceHeader)final JavaParamsnameMapper(JavaNameMapper value)final JavaParamsdependencyInjectionBuilder(IClassCmBuilder<Void> value)final JavaParamsmanagedComponentBuilder(IClassCmBuilder<Void> value)final JavaParamsisAlwaysGenerateEnumFromValueMethod(Boolean value)final JavaParamsjavaVersion(Integer value)final JavaParamsgeneratedAnnotationClass(String value)final JavaParamsgeneratedAnnotationValue(String value)final JavaParamsgeneratedAnnotation(AnnotationCm value)final JavaParamsgeneratedMarkBuilder(IClassCmBuilder<Void> value)final JavaParamsaddCodeDecorator(CodeDecorator decorator)Adds code content decorator. final JavaParamslicenceHeader(String licenceHeader)final JavaParamscopy()-
-
Method Detail
-
getNameMapper
final JavaNameMapper getNameMapper()
Name mapper from model to java.
-
setNameMapper
final Unit setNameMapper(JavaNameMapper nameMapper)
Name mapper from model to java.
-
getDependencyInjectionBuilder
final IClassCmBuilder<Void> getDependencyInjectionBuilder()
Builder for dependency injection code.
Using this parameter you will be able to specify whether dependencies will be injected using a constructor or an appropriate annotation.
Default builder marks class's fields as final if:
is not static
has not set value
is not annotated with 'org.springframework.beans.factory.annotation.Value' If the class has at least one such field, the "lombok.RequiredArgsConstructor" annotation is added.
-
setDependencyInjectionBuilder
final Unit setDependencyInjectionBuilder(IClassCmBuilder<Void> dependencyInjectionBuilder)
Builder for dependency injection code.
Using this parameter you will be able to specify whether dependencies will be injected using a constructor or an appropriate annotation.
Default builder marks class's fields as final if:
is not static
has not set value
is not annotated with 'org.springframework.beans.factory.annotation.Value' If the class has at least one such field, the "lombok.RequiredArgsConstructor" annotation is added.
-
getManagedComponentBuilder
final IClassCmBuilder<Void> getManagedComponentBuilder()
Builder for managed components used by dependency injection framework.
Using this parameter you will be able to specify annotation used to mark beans managed by dependency injection framework.
Default builder annotates the class with "org.springframework.stereotype.Component".
-
setManagedComponentBuilder
final Unit setManagedComponentBuilder(IClassCmBuilder<Void> managedComponentBuilder)
Builder for managed components used by dependency injection framework.
Using this parameter you will be able to specify annotation used to mark beans managed by dependency injection framework.
Default builder annotates the class with "org.springframework.stereotype.Component".
-
isAlwaysGenerateEnumFromValueMethod
final Boolean isAlwaysGenerateEnumFromValueMethod()
It allows to force generation of the 'fromValue' method for enums.
-
setAlwaysGenerateEnumFromValueMethod
final Unit setAlwaysGenerateEnumFromValueMethod(Boolean isAlwaysGenerateEnumFromValueMethod)
It allows to force generation of the 'fromValue' method for enums.
-
getJavaVersion
final Integer getJavaVersion()
-
setJavaVersion
final Unit setJavaVersion(Integer javaVersion)
-
getGeneratedAnnotationClass
final String getGeneratedAnnotationClass()
Specify annotation class used to marking generated classes. By default, it is 'javax.annotation.Generated' or 'javax.annotation.processing.Generated' if generation is run with java newer than 1.8.
It is not taken into account when the parameter 'generatedAnnotation' or 'generatedStrategy' is set.
-
setGeneratedAnnotationClass
final Unit setGeneratedAnnotationClass(String generatedAnnotationClass)
Specify annotation class used to marking generated classes. By default, it is 'javax.annotation.Generated' or 'javax.annotation.processing.Generated' if generation is run with java newer than 1.8.
It is not taken into account when the parameter 'generatedAnnotation' or 'generatedStrategy' is set.
-
getGeneratedAnnotationValue
final String getGeneratedAnnotationValue()
Specify annotation value used to marking generated classes. By default, it is 'pl.metaprogramming.codegen'.
It is not taken into account when the parameter 'generatedAnnotation' or 'generatedStrategy' is set.
-
setGeneratedAnnotationValue
final Unit setGeneratedAnnotationValue(String generatedAnnotationValue)
Specify annotation value used to marking generated classes. By default, it is 'pl.metaprogramming.codegen'.
It is not taken into account when the parameter 'generatedAnnotation' or 'generatedStrategy' is set.
-
getGeneratedAnnotation
final AnnotationCm getGeneratedAnnotation()
Specify annotation used to marking generated classes.
It is not taken into account when the parameter 'generatedStrategy' is set.
-
setGeneratedAnnotation
final Unit setGeneratedAnnotation(AnnotationCm generatedAnnotation)
Specify annotation used to marking generated classes.
It is not taken into account when the parameter 'generatedStrategy' is set.
-
getGeneratedMarkBuilder
final IClassCmBuilder<Void> getGeneratedMarkBuilder()
Using this parameter you will be able to specify build strategy, which will be applied to every class generation.
By default, is used to marking them with 'Generated' annotation.
-
setGeneratedMarkBuilder
final Unit setGeneratedMarkBuilder(IClassCmBuilder<Void> generatedMarkBuilder)
Using this parameter you will be able to specify build strategy, which will be applied to every class generation.
By default, is used to marking them with 'Generated' annotation.
-
getCodeDecorators
final List<CodeDecorator> getCodeDecorators()
Code contents decorators. Used to modify / decorate the text form of the generated code.
-
getLicenceHeader
final String getLicenceHeader()
-
setLicenceHeader
final Unit setLicenceHeader(String licenceHeader)
-
nameMapper
final JavaParams nameMapper(JavaNameMapper value)
-
dependencyInjectionBuilder
final JavaParams dependencyInjectionBuilder(IClassCmBuilder<Void> value)
-
managedComponentBuilder
final JavaParams managedComponentBuilder(IClassCmBuilder<Void> value)
-
isAlwaysGenerateEnumFromValueMethod
final JavaParams isAlwaysGenerateEnumFromValueMethod(Boolean value)
-
javaVersion
final JavaParams javaVersion(Integer value)
-
generatedAnnotationClass
final JavaParams generatedAnnotationClass(String value)
-
generatedAnnotationValue
final JavaParams generatedAnnotationValue(String value)
-
generatedAnnotation
final JavaParams generatedAnnotation(AnnotationCm value)
-
generatedMarkBuilder
final JavaParams generatedMarkBuilder(IClassCmBuilder<Void> value)
-
addCodeDecorator
final JavaParams addCodeDecorator(CodeDecorator decorator)
Adds code content decorator.
-
licenceHeader
final JavaParams licenceHeader(String licenceHeader)
-
copy
final JavaParams copy()
-
-
-
-