public final class ExplicitValidatorIndex extends Object implements ValidatorIndex
ExplicitValidatorIndex is an explicit registry of Validator instances. If no validator is registered
for type, a fallback validator will be used (default ALWAYS_VALID).ALWAYS_INVALID, ALWAYS_VALID| Constructor and Description |
|---|
ExplicitValidatorIndex() |
ExplicitValidatorIndex(ValidatorIndex fallbackIndex) |
| Modifier and Type | Method and Description |
|---|---|
<T> ExplicitValidatorIndex |
add(Class<T> forType,
ValidatorImpl<T> validator)
Adds a
Validator to the set of known validators. |
<T> Validator<T> |
validatorFor(Class clazz)
Returns the validator for
clazz, or ALWAYS_VALID if not found. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvalidatorForpublic ExplicitValidatorIndex()
public ExplicitValidatorIndex(ValidatorIndex fallbackIndex)
public <T> ExplicitValidatorIndex add(Class<T> forType, ValidatorImpl<T> validator)
Validator to the set of known validators.forType - the type to validatevalidator - the validator to applypublic <T> Validator<T> validatorFor(Class clazz)
ValidatorIndexclazz, or ALWAYS_VALID if not found.validatorFor in interface ValidatorIndexCopyright © 2022. All rights reserved.