public abstract class TypeValidator extends Object implements Validator
| Constructor and Description |
|---|
TypeValidator() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
appliesTo(Class<?> type)
Used by apply to figure out whether to apply the validation or simply return.
|
boolean |
apply(Class<?> type,
Object value,
List<ValidationFailure> validationFailures)
Apply validation for the given field.
|
protected abstract void |
validate(Class<?> type,
Object value,
List<ValidationFailure> validationFailures) |
public boolean apply(Class<?> type, Object value, List<ValidationFailure> validationFailures)
type - the Class of the field being queriedvalue - the value being used for a queryvalidationFailures - the list to add any failures to. If validation passes or appliesTo returned false, this list will
not change.protected abstract boolean appliesTo(Class<?> type)
type - the type to be validatedprotected abstract void validate(Class<?> type, Object value, List<ValidationFailure> validationFailures)