@Retention(value=RUNTIME)
@Target(value=TYPE)
@Documented
public @interface ConfigurationDescription
ConfigurationDescription. This description is used to
automatically validate actual configurations at application (i.e. registry)
startup. This tremendously simplifies the task of manual validation or makes
it even unnecessary in some cases. But even manual validation can be
performed by the means of a ConfigurationValidator before any
instance of the component is actually created.
Currently, ConfigurationDescription on interfaces are not supported.
ConfigurationDescriptions are inherited from all ancestor classes
(not implemented interfaces!). However, property declarations may not be
overwritten or redefined. One reason is that the configuration is provided to
the components in their constructor and it would not be possible to modify /
adapt its property values before passing it on to the constructor of the
superclass.
A ConfigurationDescription consists of zero or more Property
descriptions and an optional ConfigurationValidator that will be used
to verify the configuration at application startup.
TODO: should unknown properties in a configuration (not the description)
trigger an exception? they should probably just trigger warnings in the
logger since they're not harmful.
TODO: is more control needed over which properties are inherited from
ancestor classes or even the overriding of properties? Adding restrictions
and applying additional ConfigurationValidators shouldn't provide
any problems.
| Modifier and Type | Optional Element and Description |
|---|---|
Property[] |
properties
The configuration properties that are part of the configuration.
|
java.lang.Class<? extends ConfigurationValidator> |
validator
The validator that will be used to verify the configuration at application
startup before the component is instantiated.
|
public abstract Property[] properties
public abstract java.lang.Class<? extends ConfigurationValidator> validator
ConfigurationValidator for more information.