Class ConfigBeanBuilderCreator
java.lang.Object
io.helidon.builder.processor.tools.DefaultBuilderCreatorProvider
io.helidon.builder.config.processor.ConfigBeanBuilderCreator
- All Implemented Interfaces:
BuilderCreatorProvider
A specialization of
DefaultBuilderCreatorProvider that supports the additional
add-ons to the builder generated classes that binds to the config sub-system.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendExtraBuilderMethods(StringBuilder builder, BodyContext ctx) Adds extra builder methods.protected voidappendExtraCtorCode(StringBuilder builder, BodyContext ctx, String builderTag) Adds extra default ctor code.protected voidappendExtraFields(StringBuilder builder, BodyContext ctx) Adds extra fields on the main generated class.protected voidappendExtraImports(StringBuilder builder, BodyContext ctx) Adds extra imports to the generated builder.protected voidappendExtraToBuilderBuilderFunctions(StringBuilder builder, BodyContext ctx, String decl) Adds extra toBuilder() methods.protected voidappendMetaAttributes(StringBuilder builder, BodyContext ctx) Appends meta attribute related methods.protected voidappendMetaProps(StringBuilder builder, BodyContext ctx, String tag, AtomicBoolean needsCustomMapOf) Adds extra meta properties to the generated code.Returns any extra 'extends' type name that should be on the main generated builder type at the base level.Returns any extra 'extends' type name that should be on the main generated type at the base level.protected StringReturns theGeneratedversion identifier.protected StringinstanceIdRef(BodyContext ctx) The nuanced instance id for theDefaultBuilderCreatorProvider.appendToStringMethod(StringBuilder, BodyContext).protected booleanReturn true if the visitAttributes() methods is being overridden.protected voidpreValidate(TypeName implTypeName, TypeInfo typeInfo, AnnotationAndValue configBeanAnno) Validates the integrity of the provided arguments in the context of what is being code generated.Set<Class<? extends Annotation>>The set ofBuilder-like annotations that this creator knows how to handle.protected StringtoConfigKey(String name, boolean isAttribute) Applicable if this builder is intended for config beans.Methods inherited from class io.helidon.builder.processor.tools.DefaultBuilderCreatorProvider
appendAnnotations, appendBasicGetters, appendBuilderBuildPreSteps, appendCtorCodeBody, appendDirectNonOptionalSetter, appendExtraBuilderFields, appendExtraInnerClasses, appendExtraMethods, appendExtraPostCtorCode, appendFields, appendFooter, appendHeader, appendRequiredVisitor, appendSetter, appendToStringMethod, appendVisitAttributes, create, createBodyContext, extraImplementedBuilderContracts, extraImplementedTypeNames, fieldModifier, generatedCopyrightHeaderFor, generatedStickerFor, maybeAppendInterceptor, maybeAppendSingularSetter, maybeSingularFormOf, nameOf, normalizeConfiguredOptionKey, postValidate, toAbstractImplTypeName, toBody, toBuilderImplTypeName, toConfiguredOptionValue, toGenerics, toGenerics, toString, toString, toValue
-
Constructor Details
-
ConfigBeanBuilderCreator
Deprecated.Default constructor.
-
-
Method Details
-
supportedAnnotationTypes
Description copied from interface:BuilderCreatorProviderThe set ofBuilder-like annotations that this creator knows how to handle. Note that this annotation must also be annotated withBuilderTriggerto qualify for inclusion. This is akin toProcessor.getSupportedAnnotationTypes().- Specified by:
supportedAnnotationTypesin interfaceBuilderCreatorProvider- Overrides:
supportedAnnotationTypesin classDefaultBuilderCreatorProvider- Returns:
- Implementors should return the set of annotations they can handle
-
preValidate
protected void preValidate(TypeName implTypeName, TypeInfo typeInfo, AnnotationAndValue configBeanAnno) Description copied from class:DefaultBuilderCreatorProviderValidates the integrity of the provided arguments in the context of what is being code generated.- Overrides:
preValidatein classDefaultBuilderCreatorProvider- Parameters:
implTypeName- the implementation type nametypeInfo- the type infoconfigBeanAnno- the builder annotation triggering the code generation
-
generatedVersionFor
Description copied from class:DefaultBuilderCreatorProviderReturns theGeneratedversion identifier.- Overrides:
generatedVersionForin classDefaultBuilderCreatorProvider- Parameters:
ctx- the context- Returns:
- the generated version identifier
-
baseExtendsTypeName
Description copied from class:DefaultBuilderCreatorProviderReturns any extra 'extends' type name that should be on the main generated type at the base level.- Overrides:
baseExtendsTypeNamein classDefaultBuilderCreatorProvider- Parameters:
ctx- the context- Returns:
- extra contracts implemented
-
baseExtendsBuilderTypeName
Description copied from class:DefaultBuilderCreatorProviderReturns any extra 'extends' type name that should be on the main generated builder type at the base level.- Overrides:
baseExtendsBuilderTypeNamein classDefaultBuilderCreatorProvider- Parameters:
ctx- the context- Returns:
- extra contracts implemented
-
instanceIdRef
Description copied from class:DefaultBuilderCreatorProviderThe nuanced instance id for theDefaultBuilderCreatorProvider.appendToStringMethod(StringBuilder, BodyContext).- Overrides:
instanceIdRefin classDefaultBuilderCreatorProvider- Parameters:
ctx- the context- Returns:
- the instance id
-
appendExtraImports
Description copied from class:DefaultBuilderCreatorProviderAdds extra imports to the generated builder.- Overrides:
appendExtraImportsin classDefaultBuilderCreatorProvider- Parameters:
builder- the builderctx- the context
-
appendMetaAttributes
Description copied from class:DefaultBuilderCreatorProviderAppends meta attribute related methods.- Overrides:
appendMetaAttributesin classDefaultBuilderCreatorProvider- Parameters:
builder- the builderctx- the context
-
appendMetaProps
protected void appendMetaProps(StringBuilder builder, BodyContext ctx, String tag, AtomicBoolean needsCustomMapOf) Description copied from class:DefaultBuilderCreatorProviderAdds extra meta properties to the generated code.- Overrides:
appendMetaPropsin classDefaultBuilderCreatorProvider- Parameters:
builder- the builderctx- the contexttag- the tag used to represent the meta props variable on the generated codeneedsCustomMapOf- will be set to true if a custom map.of() function needs to be generated (i.e., if over 9 tuples)
-
appendExtraFields
Description copied from class:DefaultBuilderCreatorProviderAdds extra fields on the main generated class.- Overrides:
appendExtraFieldsin classDefaultBuilderCreatorProvider- Parameters:
builder- the builderctx- the context
-
appendExtraCtorCode
Description copied from class:DefaultBuilderCreatorProviderAdds extra default ctor code.- Overrides:
appendExtraCtorCodein classDefaultBuilderCreatorProvider- Parameters:
builder- the builderctx- the contextbuilderTag- the tag (variable name) used for the builder arg
-
appendExtraToBuilderBuilderFunctions
protected void appendExtraToBuilderBuilderFunctions(StringBuilder builder, BodyContext ctx, String decl) Description copied from class:DefaultBuilderCreatorProviderAdds extra toBuilder() methods.- Overrides:
appendExtraToBuilderBuilderFunctionsin classDefaultBuilderCreatorProvider- Parameters:
builder- the builderctx- the contextdecl- the declaration template for the toBuilder method
-
appendExtraBuilderMethods
Description copied from class:DefaultBuilderCreatorProviderAdds extra builder methods. This base implementation will write the visitAttributes() method on the generated builder class.- Overrides:
appendExtraBuilderMethodsin classDefaultBuilderCreatorProvider- Parameters:
builder- the builderctx- the context
-
overridesVisitAttributes
Description copied from class:DefaultBuilderCreatorProviderReturn true if the visitAttributes() methods is being overridden.- Overrides:
overridesVisitAttributesin classDefaultBuilderCreatorProvider- Parameters:
ctx- the context- Returns:
- true if overriding visitAttributes();
-
toConfigKey
Description copied from class:DefaultBuilderCreatorProviderApplicable if this builder is intended for config beans.- Overrides:
toConfigKeyin classDefaultBuilderCreatorProvider- Parameters:
name- the nameisAttribute- if the name represents an attribute value (otherwise is a config bean name)- Returns:
- the config key
-