Annotation Interface InjectedName


@Target(FIELD) @Retention(RUNTIME) @Documented public @interface InjectedName
This annotation marks a configuration schema field as special (read-only) for getting the key associated with the configuration in the named list. Can be used for nested configuration schema as well, but then Name should be used.

 @Config
  public class DataRegionConfigurationSchema {
      @InjectedName
       public String name;

      @Value
       public long size;
 }

 @Config
  public class DataStorageConfigurationSchema {
      @Name("default")
      @ConfigValue
       public DataRegionConfigurationSchema defaultRegion;

      @NamedConfigValue
       public DataRegionConfigurationSchema regions;
 }
 

NOTE: Field must be a String and the only one (with this annotation) in the schema, field name is used instead of NamedConfigValue.syntheticKeyName(), it can be used in schemas with Config, PolymorphicConfig and AbstractConfiguration.

See Also: