java.lang.Object
io.helidon.builder.processor.tools.BodyContext

public class BodyContext extends Object
Represents the context of the body being code generated.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • doingConcreteType

      public boolean doingConcreteType()
      Returns true if we are currently processing the concrete builder type.
      Returns:
      true if we are processing the concrete type
    • implTypeName

      public TypeName implTypeName()
      Returns the impl type name.
      Returns:
      the type name
    • typeInfo

      public TypeInfo typeInfo()
      Returns the type info.
      Returns:
      the type info
    • builderTriggerAnnotation

      public AnnotationAndValue builderTriggerAnnotation()
      Returns the builder annotation that triggered things.
      Returns:
      the builder annotation
      See Also:
    • map

      protected Map<String,TypedElementName> map()
      Returns the map of all type elements in the entire hierarchy.
      Returns:
      the map of elements by name
    • allTypeInfos

      public List<TypedElementName> allTypeInfos()
      Returns the list of all type elements.
      Returns:
      the list of type elements
    • allAttributeNames

      public List<String> allAttributeNames()
      Returns the list of all attributes names.
      Returns:
      the list of attribute names
    • parentTypeName

      public Optional<TypeName> parentTypeName()
      Returns the parent type name of the builder.
      Returns:
      the parent type name
    • parentAnnotationTypeName

      protected Optional<TypeName> parentAnnotationTypeName()
      Returns the parent annotation type name.
      Returns:
      the parent annotation type
    • hasStreamSupportOnImpl

      protected boolean hasStreamSupportOnImpl()
      Returns true if there is stream support included on the generated class.
      Returns:
      true if stream support enabled
    • hasStreamSupportOnBuilder

      protected boolean hasStreamSupportOnBuilder()
      Returns true if there is stream support included on the builder generated class.
      Returns:
      true if stream support enabled
    • includeMetaAttributes

      protected boolean includeMetaAttributes()
      Returns true if meta attributes should be generated. See Builder.includeMetaAttributes().
      Returns:
      true if meta attributes should be generated
    • requireLibraryDependencies

      protected boolean requireLibraryDependencies()
      Returns true if Helidon library dependencies should be expected. See Builder.requireLibraryDependencies().
      Returns:
      true if Helidon library dependencies are expected
    • beanStyleRequired

      protected boolean beanStyleRequired()
      Returns true if bean "getter" and "is" style is required. See Builder.requireBeanStyle() .
      Returns:
      true if bean style is required
    • allowNulls

      protected boolean allowNulls()
      Returns true if nulls are allowed. See Builder.allowNulls().
      Returns:
      true if allow nulls
    • includeGeneratedAnnotation

      protected boolean includeGeneratedAnnotation()
      Returns true if jakarta.annotations.Generated annotation should be generated. See Builder.includeGeneratedAnnotation().
      Returns:
      true if the Generated annotation should be generated on the target beans
    • listType

      public String listType()
      Returns the list type generated. See Builder.listImplType().
      Returns:
      the list type
    • mapType

      public String mapType()
      Returns the map type generated. See Builder.mapImplType().
      Returns:
      the map type
    • setType

      public String setType()
      Returns the set type generated. See Builder.setImplType().
      Returns:
      the set type
    • hasParent

      public boolean hasParent()
      Returns true if the current type has a parent.
      Returns:
      true if current has parent
    • hasAnyBuilderClashingMethodNames

      public boolean hasAnyBuilderClashingMethodNames()
      Returns true if any getter methods from the target clash with any builder method name.
      Returns:
      true if there is a clash
    • isExtendingAnAbstractClass

      public boolean isExtendingAnAbstractClass()
      Returns true if this builder is extending an abstract class as a target.
      Returns:
      true if the target is an abstract class
    • ctorBuilderAcceptTypeName

      protected TypeName ctorBuilderAcceptTypeName()
      Returns the streamable accept type of the builder and constructor.
      Returns:
      the builder accept type
    • genericBuilderClassDecl

      public String genericBuilderClassDecl()
      Returns the generic declaration for the builder class type.
      Returns:
      the generic declaration
    • genericBuilderAliasDecl

      protected String genericBuilderAliasDecl()
      Returns the builder generics alias name for the type being built.
      Returns:
      the builder generics alias name
    • genericBuilderAcceptAliasDecl

      protected String genericBuilderAcceptAliasDecl()
      Returns the builder generics alias name for the builder itself.
      Returns:
      the builder generics alias name
    • publicOrPackagePrivateDecl

      public String publicOrPackagePrivateDecl()
      Returns "public" or "" for public or package private declaration, accordingly.
      Returns:
      the modifier declaration
    • interceptorTypeName

      public Optional<TypeName> interceptorTypeName()
      Returns the interceptor implementation type name. See Builder.interceptor().
      Returns:
      the interceptor type name
    • interceptorCreateMethod

      public Optional<String> interceptorCreateMethod()
      Returns the interceptor create method name. See Builder.interceptorCreateMethod().
      Returns:
      the interceptor create method name
    • hasOtherMethod

      public boolean hasOtherMethod(String name, TypeInfo typeInfo)
      Checks whether there is an "other" method that matches the signature.
      Parameters:
      name - the method name
      typeInfo - the type info to check, which will look through the parent chain
      Returns:
      true if there is any matches
    • toBeanAttributeName

      protected static String toBeanAttributeName(TypedElementName method, boolean isBeanStyleRequired)
      returns the bean attribute name of a particular method.
      Parameters:
      method - the method
      isBeanStyleRequired - is bean style required
      Returns:
      the bean attribute name