org.springmodules.validation.util.condition.adapter
Class CommonsPredicateCondition

java.lang.Object
  extended by org.springmodules.validation.util.condition.AbstractCondition
      extended by org.springmodules.validation.util.condition.adapter.CommonsPredicateCondition
All Implemented Interfaces:
Condition

public class CommonsPredicateCondition
extends AbstractCondition

A Jakarta Commmons Predicate condition adapter. This condition deligates the call to an associated {@link Predicate).

Author:
Uri Boness

Constructor Summary
CommonsPredicateCondition(org.apache.commons.collections.Predicate predicate)
          Constructs a new CommonsPredicateCondition with a given predicate.
 
Method Summary
 boolean doCheck(Object object)
          Checks the given object against the predicate associated with this condition.
 org.apache.commons.collections.Predicate getPredicate()
          Returns the predicate associated with this condition.
 
Methods inherited from class org.springmodules.validation.util.condition.AbstractCondition
afterObjectChecked, and, beforeObjectChecked, check, or
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonsPredicateCondition

public CommonsPredicateCondition(org.apache.commons.collections.Predicate predicate)
Constructs a new CommonsPredicateCondition with a given predicate.

Parameters:
predicate - The given predicate.
Method Detail

doCheck

public boolean doCheck(Object object)
Checks the given object against the predicate associated with this condition.

Specified by:
doCheck in class AbstractCondition
Parameters:
object - The object to be checked.
Returns:
The result returned by the associated predicate when evaluting the given object. See Predicate.evaluate(Object).

getPredicate

public org.apache.commons.collections.Predicate getPredicate()
Returns the predicate associated with this condition.

Returns:
The predicate associated with this condition.


Copyright © 2009. All Rights Reserved.