public class AttributeValidatorRegistryImpl extends Object implements AttributeValidatorRegistry
| Constructor and Description |
|---|
AttributeValidatorRegistryImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
deregisterValidators(String attributeName)
Deregisters all
AttributeValidators associated with the given attribute name. |
Set<AttributeValidator> |
getValidators(String attributeName)
Gets all the
AttributeValidators associated with the given attribute name. |
void |
registerValidators(String attributeName,
Set<? extends AttributeValidator> validators)
Registers the given
AttributeValidator(s) to the given attribute name. |
public void registerValidators(String attributeName, Set<? extends AttributeValidator> validators)
AttributeValidatorRegistryAttributeValidator(s) to the given attribute name.
This method doesn't care whether an attribute with the given name actually exists; it is only responsible for managing the validators associated with a given attribute name.
Note that the AttributeValidator implementations registered should implement Object.hashCode() and Object.equals(Object) so that duplicate validators aren't
registered for an attribute.
registerValidators in interface AttributeValidatorRegistryattributeName - the name of the attribute that the given validators will validatevalidators - the AttributeValidators to apply to the attributepublic void deregisterValidators(String attributeName)
AttributeValidatorRegistryAttributeValidators associated with the given attribute name.
Does nothing if there are no validators registered to the given attribute name.
deregisterValidators in interface AttributeValidatorRegistryattributeName - the name of the attribute whose validators will be deregistered, cannot be
nullpublic Set<AttributeValidator> getValidators(String attributeName)
AttributeValidatorRegistryAttributeValidators associated with the given attribute name.getValidators in interface AttributeValidatorRegistryattributeName - the name of the attribute, cannot be nullAttributeValidators registered to the attribute, or an empty set if
no attribute by that name exists.This work is licensed under a Creative Commons Attribution 4.0 International License.