Annotation Interface PluginAttribute


Qualifier for a plugin attribute for configuration options of a plugin. A plugin attribute has a case-insensitive name and a string value which may be converted to a different type when a TypeConverter plugin exists for a target type. In a plugin class, attributes can be injected via several means:
  • a static method annotated with Factory or some other FactoryType annotation can have parameters annotated with @PluginAttribute
  • a constructor annotated with Inject can have parameters annotated with @PluginAttribute
  • a field can be annotated with PluginAttribute — note that any default value specified for this field may be overwritten with the default value specified in this annotation when the configuration attribute has no specified value
  • a method parameter can be annotated with PluginAttribute
  • an instance returned from a static Factory method may have its fields and methods injected if the instance implements Supplier

Default values may be specified via one of the defaultType attributes depending on the annotated type. Unlisted types that are supported by a corresponding TypeConverter may use the defaultString() attribute.

Plugin attributes with sensitive data such as passwords should set sensitive() to true to avoid having their values output in debug logs.

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Specifies the default boolean value to use.
    byte
    Specifies the default byte value to use.
    char
    Specifies the default byte value to use.
    Specifies the default Class value to use.
    double
    Specifies the default double floating point value to use.
    float
    Specifies the default floating point value to use.
    int
    Specifies the default integer value to use.
    long
    Specifies the default long value to use.
    short
    Specifies the default long value to use.
    Specifies the default value this attribute should use if none is provided or if the provided value is invalid.
    boolean
    Indicates that this attribute is a sensitive one that shouldn't be logged directly.
    Specifies the name of the attribute (case-insensitive) this annotation corresponds to.
  • Element Details

    • defaultBoolean

      boolean defaultBoolean
      Specifies the default boolean value to use.
      Returns:
      the default boolean value.
      Default:
      false
    • defaultByte

      byte defaultByte
      Specifies the default byte value to use.
      Returns:
      the default byte value;
      Default:
      (byte)0x00
    • defaultChar

      char defaultChar
      Specifies the default byte value to use.
      Returns:
      the default char value.
      Default:
      '\u0000'
    • defaultClass

      Class<?> defaultClass
      Specifies the default Class value to use.
      Returns:
      the default class value.
      Default:
      java.lang.Object.class
    • defaultDouble

      double defaultDouble
      Specifies the default double floating point value to use.
      Returns:
      the default double value;
      Default:
      0.0
    • defaultFloat

      float defaultFloat
      Specifies the default floating point value to use.
      Returns:
      the default float value.
      Default:
      0.0f
    • defaultInt

      int defaultInt
      Specifies the default integer value to use.
      Returns:
      the default integer value.
      Default:
      0
    • defaultLong

      long defaultLong
      Specifies the default long value to use.
      Returns:
      the default long value;
      Default:
      0L
    • defaultShort

      short defaultShort
      Specifies the default long value to use.
      Returns:
      the default short value.
      Default:
      0
    • defaultString

      String defaultString
      Specifies the default value this attribute should use if none is provided or if the provided value is invalid.
      Returns:
      the default String value.
      Default:
      ""
    • value

      String value
      Specifies the name of the attribute (case-insensitive) this annotation corresponds to. If blank, defaults to using reflection on the annotated element as such:
      • Field: uses the field name.
      • Method: when named setXYZ or withXYZ, uses the rest (XYZ) of the method name. Otherwise, uses the name of the first parameter.
      • Parameter: uses the parameter name.
      Returns:
      the value;
      Default:
      ""
    • sensitive

      boolean sensitive
      Indicates that this attribute is a sensitive one that shouldn't be logged directly. Such attributes will instead be output as a hashed value.
      Returns:
      true if the attribute should be considered sensitive.
      Default:
      false