Annotation Interface Prototype.RuntimeTypeFactoryMethod

Enclosing class:
Prototype

@Target(METHOD) @Retention(CLASS) public static @interface Prototype.RuntimeTypeFactoryMethod
Factory method that creates an option from a prototype instance. The prototype (the only parameter) must be a type that has builder method that returns a builder, that can be built using build method (method names are customizable).

The return type of the method must match the type of the option.

This annotation MUST be on a static method that is part of a type referenced from blueprint through Prototype.CustomMethods.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Name of the builder method on the prototype.
    Type of the class declaring a builderMethodName() used to get an instance of the builder to send to the generated setter with consumer.
    Type of the builder to use when creating the prototype instance.
    Name of the build method on the builder to create an instance of the desired type.
    An explicit option name can be defined to only use this factory method for the specified option.
  • Element Details

    • value

      String value
      An explicit option name can be defined to only use this factory method for the specified option. If none is specified, the factory method will be used for all options of the matching type.
      Returns:
      option name
      Default:
      ""
    • builderMethodName

      String builderMethodName
      Name of the builder method on the prototype. If set to <init>, the builder will be created through its constructor, in such a case builderType() must be provided as well.
      Returns:
      builder method name, defaults to builder if not set
      Default:
      "builder"
    • buildMethodName

      String buildMethodName
      Name of the build method on the builder to create an instance of the desired type.
      Returns:
      build method name, defaults to build if not set
      Default:
      "build"
    • builderType

      Class<?> builderType
      Type of the builder to use when creating the prototype instance.
      Returns:
      type of the builder, defaults to the type returned by the builderMethodName()
      Default:
      io.helidon.builder.api.Prototype.RuntimeTypeFactoryMethod.class
    • builderMethodType

      Class<?> builderMethodType
      Type of the class declaring a builderMethodName() used to get an instance of the builder to send to the generated setter with consumer.
      Returns:
      type declaring the builder method
      Default:
      io.helidon.builder.api.Prototype.RuntimeTypeFactoryMethod.class