Class TypedElementInfo.BuilderBase<BUILDER extends TypedElementInfo.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends TypedElementInfo>

java.lang.Object
io.helidon.common.types.TypedElementInfo.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
TypedElementInfo.Builder
Enclosing interface:
TypedElementInfo

public abstract static class TypedElementInfo.BuilderBase<BUILDER extends TypedElementInfo.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends TypedElementInfo> extends Object implements Prototype.Builder<BUILDER,PROTOTYPE>
Fluent API builder base for TypedElementInfo.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(TypedElementInfo prototype)
      Update this builder from an existing prototype instance.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(TypedElementInfo.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • clearDescription

      public BUILDER clearDescription()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • description

      public BUILDER description(String description)
      Description, such as javadoc, if available.
      Parameters:
      description - description of this element
      Returns:
      updated builder instance
      See Also:
    • typeName

      public BUILDER typeName(TypeName typeName)
      The type name for the element (e.g., java.util.List). If the element is a method, then this is the return type of the method.
      Parameters:
      typeName - the type name of the element
      Returns:
      updated builder instance
      See Also:
    • typeName

      public BUILDER typeName(Consumer<TypeName.Builder> consumer)
      The type name for the element (e.g., java.util.List). If the element is a method, then this is the return type of the method.
      Parameters:
      consumer - consumer of builder for the type name of the element
      Returns:
      updated builder instance
      See Also:
    • typeName

      public BUILDER typeName(Supplier<? extends TypeName> supplier)
      The type name for the element (e.g., java.util.List). If the element is a method, then this is the return type of the method.
      Parameters:
      supplier - supplier of the type name of the element
      Returns:
      updated builder instance
      See Also:
    • elementName

      public BUILDER elementName(String elementName)
      The element (e.g., method, field, etc) name.
      Parameters:
      elementName - the name of the element
      Returns:
      updated builder instance
      See Also:
    • elementTypeKind

      @Deprecated(since="4.1.0", forRemoval=true) public BUILDER elementTypeKind(String elementTypeKind)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use kind() instead
      The kind of element (e.g., method, field, etc).
      Parameters:
      elementTypeKind - the element kind
      Returns:
      updated builder instance
      See Also:
    • kind

      public BUILDER kind(ElementKind kind)
      The kind of element (e.g., method, field, etc).
      Parameters:
      kind - the element kind
      Returns:
      updated builder instance
      See Also:
    • clearDefaultValue

      public BUILDER clearDefaultValue()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • defaultValue

      public BUILDER defaultValue(String defaultValue)
      The default value assigned to the element, represented as a string.
      Parameters:
      defaultValue - the default value as a string
      Returns:
      updated builder instance
      See Also:
    • elementTypeAnnotations

      public BUILDER elementTypeAnnotations(List<? extends Annotation> elementTypeAnnotations)
      The list of known annotations on the type name referenced by typeName().
      Parameters:
      elementTypeAnnotations - the list of annotations on this element's (return) type.
      Returns:
      updated builder instance
      See Also:
    • addElementTypeAnnotations

      public BUILDER addElementTypeAnnotations(List<? extends Annotation> elementTypeAnnotations)
      The list of known annotations on the type name referenced by typeName().
      Parameters:
      elementTypeAnnotations - the list of annotations on this element's (return) type.
      Returns:
      updated builder instance
      See Also:
    • componentTypes

      public BUILDER componentTypes(List<? extends TypeName> componentTypes)
      Returns the component type names describing the element.
      Parameters:
      componentTypes - the component type names of the element
      Returns:
      updated builder instance
      See Also:
    • addComponentTypes

      public BUILDER addComponentTypes(List<? extends TypeName> componentTypes)
      Returns the component type names describing the element.
      Parameters:
      componentTypes - the component type names of the element
      Returns:
      updated builder instance
      See Also:
    • modifiers

      public BUILDER modifiers(Set<? extends String> modifiers)
      Element modifiers.
      Parameters:
      modifiers - element modifiers
      Returns:
      updated builder instance
      See Also:
    • addModifiers

      public BUILDER addModifiers(Set<? extends String> modifiers)
      Element modifiers.
      Parameters:
      modifiers - element modifiers
      Returns:
      updated builder instance
      See Also:
    • addModifier

      @Deprecated(since="4.1.0", forRemoval=true) public BUILDER addModifier(String modifier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use elementModifiers() instead
      Element modifiers.
      Parameters:
      modifier - element modifiers
      Returns:
      updated builder instance
      See Also:
    • elementModifiers

      public BUILDER elementModifiers(Set<? extends Modifier> elementModifiers)
      Element modifiers.
      Parameters:
      elementModifiers - element modifiers
      Returns:
      updated builder instance
      See Also:
    • addElementModifiers

      public BUILDER addElementModifiers(Set<? extends Modifier> elementModifiers)
      Element modifiers.
      Parameters:
      elementModifiers - element modifiers
      Returns:
      updated builder instance
      See Also:
    • addElementModifier

      public BUILDER addElementModifier(Modifier elementModifier)
      Element modifiers.
      Parameters:
      elementModifier - element modifiers
      Returns:
      updated builder instance
      See Also:
    • accessModifier

      public BUILDER accessModifier(AccessModifier accessModifier)
      Access modifier of the element.
      Parameters:
      accessModifier - access modifier
      Returns:
      updated builder instance
      See Also:
    • clearEnclosingType

      public BUILDER clearEnclosingType()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • enclosingType

      public BUILDER enclosingType(TypeName enclosingType)
      The enclosing type name for this typed element. Applicable when this instance represents a ElementKind.FIELD, or ElementKind.METHOD, or ElementKind.PARAMETER
      Parameters:
      enclosingType - the enclosing type element
      Returns:
      updated builder instance
      See Also:
    • enclosingType

      public BUILDER enclosingType(Consumer<TypeName.Builder> consumer)
      The enclosing type name for this typed element. Applicable when this instance represents a ElementKind.FIELD, or ElementKind.METHOD, or ElementKind.PARAMETER
      Parameters:
      consumer - the enclosing type element
      Returns:
      updated builder instance
      See Also:
    • parameterArguments

      public BUILDER parameterArguments(List<? extends TypedElementInfo> parameterArguments)
      Parameter arguments applicable if this type element represents a ElementKind.METHOD. Each instance of this list will be the individual ElementKind.PARAMETER's for the method.
      Parameters:
      parameterArguments - the list of parameters belonging to this method if applicable
      Returns:
      updated builder instance
      See Also:
    • addParameterArguments

      public BUILDER addParameterArguments(List<? extends TypedElementInfo> parameterArguments)
      Parameter arguments applicable if this type element represents a ElementKind.METHOD. Each instance of this list will be the individual ElementKind.PARAMETER's for the method.
      Parameters:
      parameterArguments - the list of parameters belonging to this method if applicable
      Returns:
      updated builder instance
      See Also:
    • addParameterArgument

      public BUILDER addParameterArgument(TypedElementInfo parameterArgument)
      Parameter arguments applicable if this type element represents a ElementKind.METHOD. Each instance of this list will be the individual ElementKind.PARAMETER's for the method.
      Parameters:
      parameterArgument - the list of parameters belonging to this method if applicable
      Returns:
      updated builder instance
      See Also:
    • addParameterArgument

      public BUILDER addParameterArgument(Consumer<TypedElementInfo.Builder> consumer)
      Parameter arguments applicable if this type element represents a ElementKind.METHOD. Each instance of this list will be the individual ElementKind.PARAMETER's for the method.
      Parameters:
      consumer - the list of parameters belonging to this method if applicable
      Returns:
      updated builder instance
      See Also:
    • throwsChecked

      public BUILDER throwsChecked(Set<? extends TypeName> throwsChecked)
      List of all thrown types that are checked (Exception and Error).
      Parameters:
      throwsChecked - set of thrown checked types
      Returns:
      updated builder instance
      See Also:
    • addThrowsChecked

      public BUILDER addThrowsChecked(Set<? extends TypeName> throwsChecked)
      List of all thrown types that are checked (Exception and Error).
      Parameters:
      throwsChecked - set of thrown checked types
      Returns:
      updated builder instance
      See Also:
    • clearOriginatingElement

      public BUILDER clearOriginatingElement()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • originatingElement

      public BUILDER originatingElement(Object originatingElement)
      The element used to create this instance. The type of the object depends on the environment we are in - it may be an Element in annotation processing, or a MethodInfo (and such) when using classpath scanning.
      Parameters:
      originatingElement - originating element
      Returns:
      updated builder instance
      See Also:
    • annotations

      public BUILDER annotations(List<? extends Annotation> annotations)
      The list of known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build.
      Parameters:
      annotations - the list of annotations on this element
      Returns:
      updated builder instance
      See Also:
    • addAnnotations

      public BUILDER addAnnotations(List<? extends Annotation> annotations)
      The list of known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build.
      Parameters:
      annotations - the list of annotations on this element
      Returns:
      updated builder instance
      See Also:
    • addAnnotation

      public BUILDER addAnnotation(Annotation annotation)
      The list of known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build.
      Parameters:
      annotation - the list of annotations on this element
      Returns:
      updated builder instance
      See Also:
    • addAnnotation

      public BUILDER addAnnotation(Consumer<Annotation.Builder> consumer)
      The list of known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build.
      Parameters:
      consumer - the list of annotations on this element
      Returns:
      updated builder instance
      See Also:
    • description

      public Optional<String> description()
      Description, such as javadoc, if available.
      Returns:
      the description
    • typeName

      public Optional<TypeName> typeName()
      The type name for the element (e.g., java.util.List). If the element is a method, then this is the return type of the method.
      Returns:
      the type name
    • elementName

      public Optional<String> elementName()
      The element (e.g., method, field, etc) name.
      Returns:
      the element name
    • elementTypeKind

      @Deprecated(since="4.1.0", forRemoval=true) public Optional<String> elementTypeKind()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use kind() instead
      The kind of element (e.g., method, field, etc).
      Returns:
      the element type kind
      See Also:
    • kind

      public Optional<ElementKind> kind()
      The kind of element (e.g., method, field, etc).
      Returns:
      the kind
      See Also:
    • defaultValue

      public Optional<String> defaultValue()
      The default value assigned to the element, represented as a string.
      Returns:
      the default value
    • elementTypeAnnotations

      public List<Annotation> elementTypeAnnotations()
      The list of known annotations on the type name referenced by typeName().
      Returns:
      the element type annotations
    • componentTypes

      public List<TypeName> componentTypes()
      Returns the component type names describing the element.
      Returns:
      the component types
    • modifiers

      @Deprecated(since="4.1.0", forRemoval=true) public Set<String> modifiers()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use elementModifiers() instead
      Element modifiers.
      Returns:
      the modifiers
      See Also:
    • elementModifiers

      public Set<Modifier> elementModifiers()
      Element modifiers.
      Returns:
      the element modifiers
      See Also:
    • accessModifier

      public Optional<AccessModifier> accessModifier()
      Access modifier of the element.
      Returns:
      the access modifier
    • enclosingType

      public Optional<TypeName> enclosingType()
      The enclosing type name for this typed element. Applicable when this instance represents a ElementKind.FIELD, or ElementKind.METHOD, or ElementKind.PARAMETER
      Returns:
      the enclosing type
    • parameterArguments

      public List<TypedElementInfo> parameterArguments()
      Parameter arguments applicable if this type element represents a ElementKind.METHOD. Each instance of this list will be the individual ElementKind.PARAMETER's for the method.
      Returns:
      the parameter arguments
    • throwsChecked

      public Set<TypeName> throwsChecked()
      List of all thrown types that are checked (Exception and Error).
      Returns:
      the throws checked
    • originatingElement

      public Optional<Object> originatingElement()
      The element used to create this instance. The type of the object depends on the environment we are in - it may be an Element in annotation processing, or a MethodInfo (and such) when using classpath scanning.
      Returns:
      the originating element
    • annotations

      public List<Annotation> annotations()
      The list of known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build.
      Returns:
      the annotations
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.