Class PrototypeInfo.BuilderBase.PrototypeInfoImpl

java.lang.Object
io.helidon.builder.codegen.PrototypeInfo.BuilderBase.PrototypeInfoImpl
All Implemented Interfaces:
Prototype.Api, PrototypeInfo, Annotated
Enclosing class:
PrototypeInfo.BuilderBase<BUILDER extends PrototypeInfo.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends PrototypeInfo>

protected static class PrototypeInfo.BuilderBase.PrototypeInfoImpl extends Object implements PrototypeInfo
Generated implementation of the prototype, can be extended by descendant prototype implementations.
  • Constructor Details

    • PrototypeInfoImpl

      protected PrototypeInfoImpl(PrototypeInfo.BuilderBase<?,?> builder)
      Create an instance providing a builder.
      Parameters:
      builder - extending builder base of this prototype
  • Method Details

    • blueprint

      public TypeInfo blueprint()
      Description copied from interface: PrototypeInfo
      Blueprint type info. A new prototype cannot be generated without a blueprint to base it on, so this is a required option.
      Specified by:
      blueprint in interface PrototypeInfo
      Returns:
      blueprint type information
    • runtimeType

      public Optional<TypeName> runtimeType()
      Description copied from interface: PrototypeInfo
      If the builder should act as a factory for another type, this is the type.

      Method Prototype.Builder.buildPrototype() builds the prototype, while method Builder.build() builds the runtime type.

      Specified by:
      runtimeType in interface PrototypeInfo
      Returns:
      runtime type, if configured
    • javadoc

      public Javadoc javadoc()
      Description copied from interface: PrototypeInfo
      Javadoc for the generated prototype.
      Specified by:
      javadoc in interface PrototypeInfo
      Returns:
      prototype javadoc
    • builderBaseJavadoc

      public Javadoc builderBaseJavadoc()
      Description copied from interface: PrototypeInfo
      Javadoc for the builder base.
      Specified by:
      builderBaseJavadoc in interface PrototypeInfo
      Returns:
      builder base javadoc
    • builderJavadoc

      public Javadoc builderJavadoc()
      Description copied from interface: PrototypeInfo
      Javadoc for the builder class.
      Specified by:
      builderJavadoc in interface PrototypeInfo
      Returns:
      builder javadoc
    • builderDecorator

      public Optional<TypeName> builderDecorator()
      Description copied from interface: PrototypeInfo
      Builder decorator, if configured.
      Specified by:
      builderDecorator in interface PrototypeInfo
      Returns:
      type of the builder decorator, if present
    • prototypeType

      public TypeName prototypeType()
      Description copied from interface: PrototypeInfo
      Type name of the generated prototype interface.

      This interface will contain the following inner classes:

      • BuilderBase - base of the builder with all setters, to support prototype inheritance
      • Builder - builder extending the builder base that builds the prototype instance
      • implementation - prototype implementation class, supports inheritance as well
      If you modify the type name to be generated, the result will not support inheritance.
      Specified by:
      prototypeType in interface PrototypeInfo
      Returns:
      type of the prototype interface
    • defaultMethodsPredicate

      public Predicate<String> defaultMethodsPredicate()
      Description copied from interface: PrototypeInfo
      A predicate to include possible interface default methods as options. The default behavior is to exclude all default methods.

      Sequence of checking if a default method should be an option method:

      • Check the method signature (i.e. process(java.lang.String), if accepted, use it as an option
      • Check the method name (i.e. process, if accepted, use it as an option
      • Otherwise the default method will not be an option
      Specified by:
      defaultMethodsPredicate in interface PrototypeInfo
      Returns:
      predicate for method names
    • accessModifier

      public AccessModifier accessModifier()
      Description copied from interface: PrototypeInfo
      Access modifier for the generated prototype.
      Specified by:
      accessModifier in interface PrototypeInfo
      Returns:
      access modifier, defaults to public
    • builderAccessModifier

      public AccessModifier builderAccessModifier()
      Description copied from interface: PrototypeInfo
      Access modifier for the generated builder.
      Specified by:
      builderAccessModifier in interface PrototypeInfo
      Returns:
      access modifier, defaults to public
    • createEmptyCreate

      public boolean createEmptyCreate()
      Description copied from interface: PrototypeInfo
      Whether to create an empty create() method.
      Specified by:
      createEmptyCreate in interface PrototypeInfo
      Returns:
      whether to create an empty create() method, defaults to true
    • recordStyle

      public boolean recordStyle()
      Description copied from interface: PrototypeInfo
      Whether to use record style or bean style accessors.

      Let's consider option accessModifier of type AccessModifier.

      Record style:

      • Getter: AccessModifier accessModifier()
      • Setter: Builder accessModifier(AccessModifier)
      Bean style:
      • Getter: AccessModifier getAccessModifier()
      • Setter: Builder setAccessModifier(AccessModifier)
      Specified by:
      recordStyle in interface PrototypeInfo
      Returns:
      whether to use record style accessors, defaults to true
    • configured

      public Optional<PrototypeConfigured> configured()
      Description copied from interface: PrototypeInfo
      Prototype configuration details.
      Specified by:
      configured in interface PrototypeInfo
      Returns:
      prototype configuration details, if configured
    • registrySupport

      public boolean registrySupport()
      Description copied from interface: PrototypeInfo
      Whether to use the service registry to discover providers.
      Specified by:
      registrySupport in interface PrototypeInfo
      Returns:
      whether to support service registry, defaults to false
    • detachBlueprint

      public boolean detachBlueprint()
      Description copied from interface: PrototypeInfo
      Whether to detach the blueprint from the generated prototype.
      Specified by:
      detachBlueprint in interface PrototypeInfo
      Returns:
      true if the blueprint should not be extended by the prototype
    • superPrototype

      public Optional<TypeName> superPrototype()
      Description copied from interface: PrototypeInfo
      If the blueprint extends an existing prototype (or blueprint), we must extend that prototype and also that prototype's builder.
      Specified by:
      superPrototype in interface PrototypeInfo
      Returns:
      super prototype, if present
    • superTypes

      public Set<TypeName> superTypes()
      Description copied from interface: PrototypeInfo
      List of types the prototype should extend. This list will always contain the blueprint interface, and Prototype.Api. This list also contains PrototypeInfo.superPrototype() if present.
      Specified by:
      superTypes in interface PrototypeInfo
      Returns:
      types the prototype must extend
    • providerProvides

      public Set<TypeName> providerProvides()
      Description copied from interface: PrototypeInfo
      Types the generated prototype should provide, if this prototype is/configures a service provider.
      Specified by:
      providerProvides in interface PrototypeInfo
      Returns:
      provider provides types
    • constants

      public List<PrototypeConstant> constants()
      Description copied from interface: PrototypeInfo
      Constants to be defined on the prototype. A constant may be either a reference to another constant or a generated value.
      Specified by:
      constants in interface PrototypeInfo
      Returns:
      constants to add to the prototype
    • prototypeMethods

      public List<GeneratedMethod> prototypeMethods()
      Description copied from interface: PrototypeInfo
      Additional methods to be added to the prototype as default methods.

      Non-default interface methods cannot be added, as the implementation is not customizable. This list does NOT contain option methods.

      Specified by:
      prototypeMethods in interface PrototypeInfo
      Returns:
      custom methods to add to the prototype
    • builderMethods

      public List<GeneratedMethod> builderMethods()
      Description copied from interface: PrototypeInfo
      Additional methods to be added to the prototype builder base. It is your responsibility to ensure these methods do not conflict with option methods. This list does NOT contain option methods.
      Specified by:
      builderMethods in interface PrototypeInfo
      Returns:
      custom methods to add to the prototype builder base
    • deprecatedFactoryMethods

      @Deprecated(since="4.4.0", forRemoval=true) public List<DeprecatedFactoryMethod> deprecatedFactoryMethods()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: PrototypeInfo
      Static factory methods to be added to the prototype, or runtime type factory methods.

      This method exists only for backwards compatibility and will be removed in a future major version.

      Specified by:
      deprecatedFactoryMethods in interface PrototypeInfo
      Returns:
      a list of factory methods declared on the blueprint or a reference custom methods type
    • prototypeFactories

      public List<GeneratedMethod> prototypeFactories()
      Description copied from interface: PrototypeInfo
      Static factory methods to be added to the prototype.
      Specified by:
      prototypeFactories in interface PrototypeInfo
      Returns:
      a list of factory methods to add to the prototype
    • configFactories

      public List<FactoryMethod> configFactories()
      Description copied from interface: PrototypeInfo
      Factory methods to be used when mapping config to types. These methods will never be made public.

      Config factory methods may exist for a specific option, or for any option that matches the type.

      Specified by:
      configFactories in interface PrototypeInfo
      Returns:
      factory methods to use when mapping config to types
    • runtimeTypeFactories

      public List<RuntimeTypeInfo> runtimeTypeFactories()
      Description copied from interface: PrototypeInfo
      Factory methods to create runtime types from a builder. If a method is available for a specific option and matches its types, a setter with a parameter of consumer of the builder type will be added to the builder base.

      Runtime factory methods may exist for a specific option, or for any option that matches the type.

      Specified by:
      runtimeTypeFactories in interface PrototypeInfo
      Returns:
      factory methods to create runtime types from a builder
    • annotations

      public List<Annotation> annotations()
      Description copied from interface: Annotated
      List of declared and known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build (such as the of the annotation).
      Specified by:
      annotations in interface Annotated
      Returns:
      the list of annotations declared on this element
    • inheritedAnnotations

      public List<Annotation> inheritedAnnotations()
      Description copied from interface: Annotated
      List of all inherited annotations for this element. Inherited annotations are annotations declared on annotations of this element that are also marked as Inherited.

      The returned list does not contain Annotated.annotations(). If a meta-annotation is present on multiple annotations, it will be returned once for each such declaration.

      This method does not return annotations on super types or interfaces!

      Specified by:
      inheritedAnnotations in interface Annotated
      Returns:
      list of all meta annotations of this element
    • toString

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object