public class PastValidatorForDate extends Object implements ConstraintValidator<Past,Date>
java.util.Date passed to be validated is in the
past.| Constructor and Description |
|---|
PastValidatorForDate() |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(Past constraintAnnotation)
Initialize the validator in preparation for isValid calls.
|
boolean |
isValid(Date date,
ConstraintValidatorContext constraintValidatorContext)
Implement the validation logic.
|
public void initialize(Past constraintAnnotation)
ConstraintValidatorinitialize in interface ConstraintValidator<Past,Date>constraintAnnotation - annotation instance for a given constraint declarationpublic boolean isValid(Date date, ConstraintValidatorContext constraintValidatorContext)
ConstraintValidatorvalue must not be altered.
This method can be accessed concurrently, thread-safety must be ensured
by the implementation.isValid in interface ConstraintValidator<Past,Date>date - object to validateconstraintValidatorContext - context in which the constraint is evaluatedvalue does not pass the constraintCopyright © 2012 JBoss by Red Hat. All Rights Reserved.