Annotation Interface ConfigurationRoot


@Target(TYPE) @Retention(RUNTIME) @Documented public @interface ConfigurationRoot
This annotation, if applied to a class, marks it as a configuration schema root. Annotation processor generates several classes for each configuration schema:
  • Config - Represents the configuration, provides API to init, change and view it. Extends DynamicConfiguration
  • Change - changes the config tree
  • View - an immutable object to view the config tree
Here is how to create a root configuration schema:

 @ConfigurationRoot(rootName = "a.b", type = ConfigurationType.LOCAL)
 public class LocalConfigurationSchema {

      @Value
      public String foo;

      @Value
      public boolean bar;

      @ConfigValue
      public SomeOtherConfiguration someOther;
 }
 

The main difference between @ConfigurationRoot and @Config is that the former marks schema root, while the latter is for marking non-root parts of the schema.

See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Returns the unique root name.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Returns the type of the configuration.
  • Element Details

    • rootName

      String rootName
      Returns the unique root name.
      Returns:
      Unique root name.
    • type

      Returns the type of the configuration.
      Returns:
      Type of the configuration.
      Default:
      LOCAL