Annotation Type ConfigurationDescription
-
@Retention(RUNTIME) @Target(TYPE) @Documented public @interface ConfigurationDescription
Classes specified as implementation for a component type may be annotated with aConfigurationDescription. 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 aConfigurationValidatorbefore any instance of the component is actually created.Currently,
ConfigurationDescriptionon 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
ConfigurationDescriptionconsists of zero or morePropertydescriptions and an optionalConfigurationValidatorthat 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 additionalConfigurationValidators shouldn't provide any problems.- Author:
- Patrick Schmidt
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description Property[]propertiesThe configuration properties that are part of the configuration.Class<? extends ConfigurationValidator>validatorThe validator that will be used to verify the configuration at application startup before the component is instantiated.
-
-
-
Element Detail
-
properties
Property[] properties
The configuration properties that are part of the configuration.- Returns:
- the configuration properties that are part of the configuration
- Default:
- {}
-
-
-
validator
Class<? extends ConfigurationValidator> validator
The validator that will be used to verify the configuration at application startup before the component is instantiated. SeeConfigurationValidatorfor more information.- Returns:
- validator that will be used to verify the configuration
- Default:
- de.aristaflow.adept2.base.configuration.EmptyConfigurationValidator.class
-
-