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

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
All Implemented Interfaces:
Condition
Direct Known Subclasses:
IsAfterDateCondition, IsBeforeDateCondition, IsInTheFutureDateCondition, IsInThePastDateCondition

public abstract class AbstractDateCondition
extends NonNullAcceptingTypeSpecificCondition

A base class for all date-time related conditions.

Author:
Uri Boness

Constructor Summary
protected AbstractDateCondition()
           
 
Method Summary
protected abstract  boolean checkCalendar(Calendar calendar)
          Checks this condition on the given calendar.
 boolean doCheck(Object object)
          See Condition.check(Object).
 
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

AbstractDateCondition

protected AbstractDateCondition()
Method Detail

doCheck

public final boolean doCheck(Object object)
See Condition.check(Object).

This method casts or converts the given object to a Calendar instance and delegates the call to checkCalendar(java.util.Calendar).

Specified by:
doCheck in class AbstractCondition
Parameters:
object - The object to be checked.
Returns:
true if the given object adheres to this condition, false otherwise.
Throws:
IllegalArgumentException - when the passed in object is either null or of a type other than Calendar or Date.

checkCalendar

protected abstract boolean checkCalendar(Calendar calendar)
Checks this condition on the given calendar.

Parameters:
calendar - The calendar to be checks.
Returns:
true if checkCalendar passed, false if the checkCalendar failed.


Copyright © 2009. All Rights Reserved.