org.springmodules.validation.util.condition.range
Class AbstractRangeCondition

java.lang.Object
  extended by org.springmodules.validation.util.condition.AbstractCondition
      extended by org.springmodules.validation.util.condition.NonNullAcceptingCondition
          extended by org.springmodules.validation.util.condition.range.AbstractRangeCondition
All Implemented Interfaces:
Condition
Direct Known Subclasses:
AbstractBetweenCondition, AbstractSingleBoundCondition

public abstract class AbstractRangeCondition
extends NonNullAcceptingCondition

A base class for all range conditions.

Author:
Uri Boness

Constructor Summary
AbstractRangeCondition(Comparator comparator)
          Constructs a new AbstractRangeCondition.
 
Method Summary
protected abstract  boolean checkRange(Object value, Comparator comparator)
          Checks the condition upon the given range object.
 boolean doCheck(Object bean)
          See AbstractCondition.doCheck(Object).
 
Methods inherited from class org.springmodules.validation.util.condition.NonNullAcceptingCondition
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

AbstractRangeCondition

public AbstractRangeCondition(Comparator comparator)
Constructs a new AbstractRangeCondition.

Method Detail

doCheck

public final boolean doCheck(Object bean)
See AbstractCondition.doCheck(Object).

Delegates to checkRange(Object, java.util.Comparator)

Specified by:
doCheck in class AbstractCondition
Parameters:
bean - The object to be checked.
Returns:
true if the given object adheres to this condition, false otherwise.

checkRange

protected abstract boolean checkRange(Object value,
                                      Comparator comparator)
Checks the condition upon the given range object.

Parameters:
value - The value to be checked
comparator - The comparator to be used for the checked value.
Returns:
true if the given range adheres to this condition, false otherwise.


Copyright © 2009. All Rights Reserved.