|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.spi.config.validation.ConfigurationValidator
public final class ConfigurationValidator
Helper to validate sets of properties. Helpful for ConfigurationProperties
.
Constructor Summary | |
---|---|
ConfigurationValidator(ConfigurationPropertiesManagement configuration) Default constructor for non-lenient validation. |
|
ConfigurationValidator(ConfigurationPropertiesManagement configuration, boolean lenient) Default constructor. |
Method Summary | |
---|---|
void |
validate(PropertyCollection properties, Class<?>... groups) Validates the given properties. |
void |
validate(PropertyDescriptor descriptor, Object value, Class<?>... groups) Validates the given value for the given descriptor and groups. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConfigurationValidator(ConfigurationPropertiesManagement configuration)
configuration
- the configuration to validate.
public ConfigurationValidator(ConfigurationPropertiesManagement configuration, boolean lenient)
configuration
- the configuration to validate.
lenient
- the lenient flag that tells the validation process to handle unknown properties gracefully if set to
true
.
Method Detail |
---|
public void validate(PropertyCollection properties, Class<?>... groups) throws de.smartics.util.lang.NullArgumentException, ConfigurationValidationException
properties
- the properties to validate.
de.smartics.util.lang.NullArgumentException
- if
properties
is
null
.
ConfigurationValidationException
- if validation fails.
public void validate(PropertyDescriptor descriptor, Object value, Class<?>... groups)
descriptor
- the descriptor to determine the constraints to check.
value
- the value to check.
groups
- the constraint groups to consider. If empty or
null
only the constraints in the default are checked.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |