org.apache.bval.constraints
Class PastValidatorForDate

java.lang.Object
  extended by 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


Constructor Summary
PastValidatorForDate()
           
 
Method Summary
 void initialize(Past annotation)
           
 boolean isValid(Date date, ConstraintValidatorContext context)
           
protected  Date now()
          overwrite when you need a different algorithm for 'now'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PastValidatorForDate

public PastValidatorForDate()
Method Detail

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.