public abstract class ValueValidator extends Object implements Validator
| Constructor and Description |
|---|
ValueValidator() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(Class<?> type,
Object value,
List<ValidationFailure> validationFailures)
Applied validation for the given field.
|
protected abstract Class<?> |
getRequiredValueType()
Used by
apply to figure out whether to apply the validation or simply return. |
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 non-null 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 Class<?> getRequiredValueType()
apply to figure out whether to apply the validation or simply return.protected abstract void validate(Class<?> type, Object value, List<ValidationFailure> validationFailures)