public interface AttributeValidatorRegistry
This code is experimental. While this interface is functional and tested, it may change or be removed in a future version of the library.
Modifier and Type | Method and Description |
---|---|
void |
deregisterValidators(String attributeName)
Deregisters all
AttributeValidator s associated with the given attribute name. |
Set<AttributeValidator> |
getValidators(String attributeName)
Gets all the
AttributeValidator s associated with the given attribute name. |
void |
registerValidators(String attributeName,
Set<? extends AttributeValidator> validators)
Registers the given
AttributeValidator (s) to the given attribute name. |
void registerValidators(String attributeName, Set<? extends AttributeValidator> validators)
AttributeValidator
(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.
attributeName
- the name of the attribute that the given validators will validatevalidators
- the AttributeValidator
s to apply to the attributeIllegalArgumentException
- if attributeName
is null, or if no AttributeValidator
s were passedvoid deregisterValidators(String attributeName)
AttributeValidator
s associated with the given attribute name.
Does nothing if there are no validators registered to the given attribute name.
attributeName
- the name of the attribute whose validators will be deregistered, cannot be
nullIllegalArgumentException
- if attributeName
is nullSet<AttributeValidator> getValidators(String attributeName)
AttributeValidator
s associated with the given attribute name.attributeName
- the name of the attribute, cannot be nullAttributeValidator
s registered to the attribute, or an empty set if
no attribute by that name exists.IllegalArgumentException
- if attributeName
is nullThis work is licensed under a Creative Commons Attribution 4.0 International License.