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
Twith a methodpublic static T valueOf(String) - Any class or interface
Twith a methodpublic static T fromString(String) - Any class or interface
Twith a constructorpublic T(String)
-
Field Summary
Fields -
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe default value to use if the environment variable is not set.
-
Field Details
-
DEFAULT_VALUE_NOT_SET
- See Also:
-
-
Element Details
-
value
String valueThe name of the environment variable to read. -
defaultValue
String defaultValueThe default value to use if the environment variable is not set. If not set, the default value isDEFAULT_VALUE_NOT_SET.- Default:
"__UNDEFINED__"
-