Annotation Type ConfigurationProperties


  • @Singleton
    @Documented
    @Retention(RUNTIME)
    @Target({TYPE,ANNOTATION_TYPE,METHOD,CONSTRUCTOR})
    @ConfigurationReader
    public @interface ConfigurationProperties

    Defines a singleton bean whose property values are resolved from a PropertyResolver.

    The PropertyResolver is typically the Micronaut Environment.

    The value() of the annotation is used to indicate the prefix where the configuration properties are located. The class can define properties or fields which will have the configuration properties to them at runtime.

    Complex nested properties are supported via classes that are public static inner classes and are also annotated with ConfigurationProperties.

    Since:
    1.0
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String value
      The prefix to use when resolving properties.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String[] cliPrefix
      If the properties of this configuration can also be resolved from the CLI a prefix can be specified.
      java.lang.String[] excludes  
      java.lang.String[] includes  
    • Element Detail

      • value

        @AliasFor(annotation=ConfigurationReader.class,
                  member="value")
        java.lang.String value
        The prefix to use when resolving properties. The prefix should be defined in kebab case. Example: my-app.foo.
        Returns:
        The prefix to use to resolve the properties
      • cliPrefix

        java.lang.String[] cliPrefix

        If the properties of this configuration can also be resolved from the CLI a prefix can be specified.

        For example given a prefix value {code server-} and a property called {code port}, Micronaut will attempt to resolve the value of --server-port when specified on the command line

        Returns:
        The CLI prefix of the configuration. If a blank string is used then no prefix is appended
        Default:
        {}