Annotation Type EnvironmentVariable


@Qualifier @Qualifier @Retention(CLASS) @Target({PARAMETER,FIELD,METHOD}) public @interface EnvironmentVariable
Indicates an injection site should be populated with the value of the given environment variable. The value of the environment variable is read at runtime. If the environment variable is not set, then the default value is used instead, if given. If no default value is given, then the value is null.

The annotated element must be one of the following types:

  • String
  • Any primitive type
  • Any boxed primitive type
  • Any class or interface T with a method public static T valueOf(String)
  • Any class or interface T with a method public static T fromString(String)
  • Any class or interface T with a constructor public T(String)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of the environment variable to read.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The default value to use if the environment variable is not set.
  • Field Details

  • Element Details

    • value

      String value
      The name of the environment variable to read.
    • defaultValue

      String defaultValue
      The default value to use if the environment variable is not set. If not set, the default value is DEFAULT_VALUE_NOT_SET.
      Default:
      "__UNDEFINED__"