org.apache.bval.constraints
Class PastValidatorForDate
java.lang.Object
org.apache.bval.constraints.PastValidatorForDate
- All Implemented Interfaces:
- ConstraintValidator<Past,Date>
public class PastValidatorForDate
- extends Object
- implements ConstraintValidator<Past,Date>
Description: validate a date or calendar representing a date in the past
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PastValidatorForDate
public PastValidatorForDate()
initialize
public void initialize(Past annotation)
- Specified by:
initialize
in interface ConstraintValidator<Past,Date>
isValid
public boolean isValid(Date date,
ConstraintValidatorContext context)
- Specified by:
isValid
in interface ConstraintValidator<Past,Date>
now
protected Date now()
- overwrite when you need a different algorithm for 'now'.
- Returns:
- current date/time
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.