Supplemental annotation types that are supported in conjunction with this builder type include:
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe prefix name that will be assigned to the abstract implementation class that is code generated.booleanShould the bean and the builder allow for the possibility of nullable non-Optionalvalues to be present.booleanDefault methods are normally skipped.The prefix name that will be assigned to the implementation class that is code generated.The suffix name that will be assigned to the implementation class that is code generated.booleanShould the code generated types included theGeneratedannotation.booleanShould the code-generates source(s) be capable of providing meta-related extensions.Class<?>The interceptor implementation type.The (static) interceptor method to call on theinterceptor()implementation type in order to create the interceptor.The list implementation type to apply, defaulting toDEFAULT_LIST_TYPE.The map implementation type to apply, defaulting toDEFAULT_MAP_TYPE.The package name to use for the generated class.booleanShould bean style be enforced.booleanShould the code-generated source(s) require a runtime dependency on Helidon libraries? The default istrue.The set implementation type to apply, defaulting toDEFAULT_SET_TYPE. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default prefix appended to the generated abstract class name (the parent for theDEFAULT_IMPL_PREFIX).static final booleanThe default value forallowNulls().static final booleanThe default value fordefineDefaultMethods().static final StringThe default prefix appended to the generated class name.static final booleanThe default value forincludeGeneratedAnnotation().static final StringThe default suffix appended to the generated class name(s).
-
Field Details
-
DEFAULT_IMPL_PREFIX
The default prefix appended to the generated class name.- See Also:
-
DEFAULT_ABSTRACT_IMPL_PREFIX
The default prefix appended to the generated abstract class name (the parent for theDEFAULT_IMPL_PREFIX).- See Also:
-
DEFAULT_SUFFIX
The default suffix appended to the generated class name(s).- See Also:
-
DEFAULT_ALLOW_NULLS
static final boolean DEFAULT_ALLOW_NULLSThe default value forallowNulls().- See Also:
-
DEFAULT_INCLUDE_GENERATED_ANNOTATION
static final boolean DEFAULT_INCLUDE_GENERATED_ANNOTATIONThe default value forincludeGeneratedAnnotation().- See Also:
-
DEFAULT_DEFINE_DEFAULT_METHODS
static final boolean DEFAULT_DEFINE_DEFAULT_METHODSThe default value fordefineDefaultMethods().- See Also:
-
DEFAULT_LIST_TYPE
-
DEFAULT_MAP_TYPE
-
DEFAULT_SET_TYPE
-
-
Element Details
-
packageName
String packageNameThe package name to use for the generated class. If the package name starts with "." then the package name will be relative to the target type. If left undefined (i.e., an empty string) it will default to the target type's package name.- Returns:
- the package name to use for the generated class
- Default:
""
-
implPrefix
String implPrefixThe prefix name that will be assigned to the implementation class that is code generated. Default isDEFAULT_IMPL_PREFIX.Note also that if your application uses a super builder inheritance scheme (i.e., A extends B extends C) then it is expected that all the Builder annotations for this attribute is set uniformly to the same value.
- Returns:
- the prefix name
- Default:
"Default"
-
abstractImplPrefix
String abstractImplPrefixThe prefix name that will be assigned to the abstract implementation class that is code generated. Default isDEFAULT_ABSTRACT_IMPL_PREFIX.Note also that if your application uses a super builder inheritance scheme (i.e., A extends B extends C) then it is expected that all the Builder annotations for this attribute is set uniformly to the same value.
- Returns:
- the prefix name
- Default:
"Abstract"
-
implSuffix
String implSuffixThe suffix name that will be assigned to the implementation class that is code generated. Default isDEFAULT_SUFFIX.Note also that if your application uses a super builder inheritance scheme (i.e., A extends B extends C) then it is expected that all the Builder annotations for this attribute is set uniformly to the same value.
- Returns:
- the suffix name
- Default:
""
-
requireLibraryDependencies
boolean requireLibraryDependenciesShould the code-generated source(s) require a runtime dependency on Helidon libraries? The default istrue.When set to
true, the generated Builder class will rely on common libraries from Helidon as the basis forBuilder,AttributeVisitor, etc. This would therefore require your consumer application to have a compile/runtime dependency on thebuilder/runtime-toolsmodule (having an additional transitive dependency oncommon/common.When set to
false, the generated source(s) will self-contain all the supporting types, and thereby avoids any dependencies on any extra Helidon libraries. The cost, however, is code duplication since each builder generated will replicate these types.Note also that if your application uses a super builder inheritance scheme (i.e., A extends B extends C) then it is expected that all the Builder annotations for this attribute is set uniformly to the same value.
- Returns:
- true to extend and use supporting libraries to avoid duplication of generated types
- Default:
true
-
includeMetaAttributes
boolean includeMetaAttributesShould the code-generates source(s) be capable of providing meta-related extensions. This includes, but is not limited to, the following:- access to attribute names, types, and ConfigurationOption attributes in a map-like structure - avoiding runtime reflection
- providing attribute visitor and visitation capabilities
- providing ConfigurationOption#required=true validation (based upon the above visitors)
true. Note also that in some (future) scenarios, Helidon will mandate this attribute be enabled.Note also that if your application uses a super builder inheritance scheme (i.e., A extends B extends C) then it is expected that all the Builder annotations for this attribute is set uniformly to the same value.
- Returns:
- true to support meta-related attributes and extensions
- Default:
true
-
requireBeanStyle
boolean requireBeanStyleShould bean style be enforced. Set totrueto force the use of isX() (for booleans) or getY() (for non booleans) on the target type's methods. Default isfalse. When enabled then any violation of this will lead to a compile-time error by the Builder's annotation processor. Default isfalse.- Returns:
- true to enforce bean style
- Default:
false
-
allowNulls
boolean allowNullsShould the bean and the builder allow for the possibility of nullable non-Optionalvalues to be present. Default isfalse.- Returns:
- true to allow for the possibility of nullable non-Optional values to be present
- Default:
false
-
includeGeneratedAnnotation
boolean includeGeneratedAnnotationShould the code generated types included theGeneratedannotation. Including this annotation will require an additional module dependency on your modules to includejakarta.annotation-api.- Returns:
- true to include the Generated annotation
- Default:
true
-
defineDefaultMethods
boolean defineDefaultMethodsDefault methods are normally skipped. Setting this to true will allow definition for alldefaultmethods from the target type, but only for getter-type methods taking no arguments.- Returns:
- true to define default methods
- Default:
false
-
interceptor
Class<?> interceptorThe interceptor implementation type. SeeBuilderInterceptorfor further details. Any interceptor applied will be called prior to validation. The interceptor implementation can be any lambda-like implementation for theBuilderInterceptorfunctional interface. This means that the implementation should declare a public method that matches the following:
Note that the method name must be named intercept.Builder intercept(Builder builder);- Returns:
- the interceptor implementation class
- Default:
java.lang.Void.class
-
interceptorCreateMethod
String interceptorCreateMethodThe (static) interceptor method to call on theinterceptor()implementation type in order to create the interceptor. If left undefined then thenewoperator will be called on the type. If provided then the method must be public and take no arguments. Example (see the create() method):public class CustomBuilderInterceptor { // implements BuilderInterceptor public CustomBuilderInterceptor() { } public static CustomBuilderInterceptor create() { ... } public Builder intercept(Builder builder) { ... } }This attribute is ignored if the
interceptor()class type is left undefined. Note that the method must return an instance of the Builder, and there must be a public method that matches the following:
Note that the method name must be named intercept.public Builder intercept(Builder builder);- Returns:
- the interceptor create method
- Default:
""
-
listImplType
The list implementation type to apply, defaulting toDEFAULT_LIST_TYPE.- Returns:
- the list type to apply
- Default:
java.util.ArrayList.class
-
mapImplType
The map implementation type to apply, defaulting toDEFAULT_MAP_TYPE.- Returns:
- the map type to apply
- Default:
java.util.LinkedHashMap.class
-
setImplType
The set implementation type to apply, defaulting toDEFAULT_SET_TYPE.- Returns:
- the set type to apply
- Default:
java.util.LinkedHashSet.class
-