T - Supported value typepublic class DefaultValidator<T> extends Object implements Validator<T>
Validator.PatternFlag, Validator.UnsupportedValidationTypeException, Validator.Validatable<T>, Validator.ValidationException, Validator.ValidationMessage, Validator.ValidatorSupport<T>DEFAULT_MESSAGE_CODE_PREFIX| Constructor and Description |
|---|
DefaultValidator(Predicate<T> predicate,
Localizable message) |
| Modifier and Type | Method and Description |
|---|---|
void |
validate(T value)
Validate given
value. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, create, digits, digits, digits, email, email, email, future, future, future, greaterOrEqual, greaterOrEqual, greaterOrEqual, greaterThan, greaterThan, greaterThan, in, in, in, isNull, isNull, isNull, lessOrEqual, lessOrEqual, lessOrEqual, lessThan, lessThan, lessThan, max, max, max, min, min, min, notBlank, notBlank, notBlank, notEmpty, notEmpty, notEmpty, notIn, notIn, notIn, notNegative, notNegative, notNegative, notNull, notNull, notNull, notZero, notZero, notZero, past, past, past, pattern, pattern, patternpublic DefaultValidator(Predicate<T> predicate, Localizable message)
public void validate(T value) throws Validator.ValidationException
Validatorvalue. If the value is not valid, an Validator.ValidationException is thrown.
The Validator.ValidationException is Localizable, providing optional message code and arguments for
validation message localization.
validate in interface Validator<T>value - The value to validate (may be null)Validator.ValidationException - If the value is not valid, providing the validation error message.Copyright © 2019 The Holon Platform. All rights reserved.