public final class ConfigurationDescriptionTools
extends java.lang.Object
configuration descriptions and
configurations.| Modifier and Type | Method and Description |
|---|---|
static Configuration |
validateConfiguration(Configuration instConf,
java.lang.Class<?> implementingClass,
boolean includeIfaces,
java.lang.String instanceName)
Validates the given configuration against the
ConfigurationDescription of the designated class its parent classes
and optionally also its (parent) interfaces. |
static Configuration |
validateConfiguration(Configuration instConf,
java.lang.Class<?> implementingClass,
java.lang.String instanceName)
Validates the given configuration against the
ConfigurationDescription of the given class. |
static void |
validateConfigurationDescription(java.lang.Class<?> implementingClass)
Validates the
ConfigurationDescription of the given class including
its subclasses. |
public static void validateConfigurationDescription(java.lang.Class<?> implementingClass)
throws IllegalConfigurationDescriptionException
ConfigurationDescription of the given class including
its subclasses. This does not include interfaces!implementingClass - the class implementing a component type (and
potentially annotated (or its ancestor classes) with
ConfigurationDescription)IllegalConfigurationDescriptionException - if the configuration
descriptions contains inherent errors, like a default value that
doesn't match the specified type of a property or a
ConfigurationValidator that can't be instantiatedpublic static Configuration validateConfiguration(Configuration instConf, java.lang.Class<?> implementingClass, java.lang.String instanceName) throws ConfigurationException
ConfigurationDescription of the given class. If the given class and
all of its ancestors are not annotated with ConfigurationDescription this method will just return.
For missing values of configuration entries that are not marked as required their default value will be filled into the configuration. Please note that a property value is not considered missing as long as the default / anonymous instance provides a value for that property.
instConf - the configuration of an instance of the componentimplementingClass - the class implementing a component type (and
potentially annotated withinstanceName - the instance name is only needed to provide better
messages in exceptionsConfigurationException - if the configuration contained errorspublic static Configuration validateConfiguration(Configuration instConf, java.lang.Class<?> implementingClass, boolean includeIfaces, java.lang.String instanceName) throws ConfigurationException
ConfigurationDescription of the designated class its parent classes
and optionally also its (parent) interfaces. If the designated class and
all of its ancestors (possibly including interfaces) are not annotated with
ConfigurationDescription this method will just return.
For missing values of configuration entries that are not marked as required their default value will be filled into the configuration. Please note that a property value is not considered missing as long as the default / anonymous instance provides a value for that property.
instConf - the configuration of an instance of the componentimplementingClass - the class implementing a component type (and
potentially annotated withincludeIfaces - Whether to also validate the interfaces (and all
parent interfaces) of the designated class.instanceName - the instance name is only needed to provide better
messages in exceptionsConfigurationException - if the configuration contained errors