Annotation Interface Configuration.Value

Enclosing class:
Configuration

@Target(PARAMETER) @Retention(CLASS) @Documented @Qualifier public static @interface Configuration.Value
A qualifier for injection of a single value from the configuration tree.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Configuration key (from the config root) or configuration expression to find the value.
  • Element Details

    • value

      String value
      Configuration key (from the config root) or configuration expression to find the value.

      Default configuration key is <class_name>.<field_name> for field injection (if supported), and <className>.<constructor_param_name> for constructor injection. The <class_name> is the fully qualified class name of the type that uses this annotation.

      In addition to plain keys such as app.greeting, this annotation supports the standard configuration-expression syntax ${key:default}. Expressions may be the whole value, such as ${app.greeting:Hello}, or part of a composite string, such as Hello ${app.name:World}.

      Note that parameter names are not retained at runtime, so the parameter name when not using build time processing would be generated by the JVM.

      If a whole expression does not resolve and does not define an inline default, one of the Default annotations can still be used as a fallback.

      Returns:
      configuration key or expression
      Default:
      ""