org.springmodules.validation.util.condition.date
Class IsBeforeDateCondition

java.lang.Object
  extended by org.springmodules.validation.util.condition.AbstractCondition
      extended by org.springmodules.validation.util.condition.TypeSpecificCondition
          extended by org.springmodules.validation.util.condition.NonNullAcceptingTypeSpecificCondition
              extended by org.springmodules.validation.util.condition.date.AbstractDateCondition
                  extended by org.springmodules.validation.util.condition.date.IsBeforeDateCondition
All Implemented Interfaces:
Condition

public class IsBeforeDateCondition
extends AbstractDateCondition

An AbstractDateCondition implementation that checks whether the checked calendar is chronologically before a specific calendar.

Author:
Uri Boness

Constructor Summary
IsBeforeDateCondition(Calendar later)
          Constructs a new IsBeforeDateCondition with a given calendar to be compared with the checked calendar.
IsBeforeDateCondition(Date later)
          Constructs a new IsBeforeDateCondition with a given date to be compared with the checked calendar.
 
Method Summary
protected  boolean checkCalendar(Calendar calendar)
          Checks whether the given calendar is chornologically before the calendar associated with this condition.
 Calendar getLater()
          Returns the calendar associated with this condition.
 
Methods inherited from class org.springmodules.validation.util.condition.date.AbstractDateCondition
doCheck
 
Methods inherited from class org.springmodules.validation.util.condition.NonNullAcceptingTypeSpecificCondition
beforeObjectChecked
 
Methods inherited from class org.springmodules.validation.util.condition.AbstractCondition
afterObjectChecked, and, check, or
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsBeforeDateCondition

public IsBeforeDateCondition(Date later)
Constructs a new IsBeforeDateCondition with a given date to be compared with the checked calendar.

Parameters:
later - The date to be compared with the checked calendar.

IsBeforeDateCondition

public IsBeforeDateCondition(Calendar later)
Constructs a new IsBeforeDateCondition with a given calendar to be compared with the checked calendar.

Parameters:
later - The calendar to be compared with the checked calendar.
Method Detail

checkCalendar

protected boolean checkCalendar(Calendar calendar)
Checks whether the given calendar is chornologically before the calendar associated with this condition.

Specified by:
checkCalendar in class AbstractDateCondition
Parameters:
calendar - The calendar to be checked.
Returns:
true if the given calender comes before the calendar associated with this condition, false otherwise.

getLater

public Calendar getLater()
Returns the calendar associated with this condition.

Returns:
The calendar associated with this condition.


Copyright © 2009. All Rights Reserved.