org.springmodules.validation.util.condition.collection
Class NoneCollectionCondition

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.collection.AbstractCollectionCondition
              extended by org.springmodules.validation.util.condition.collection.AbstractCollectionElementCondition
                  extended by org.springmodules.validation.util.condition.collection.NoneCollectionCondition
All Implemented Interfaces:
Condition

public class NoneCollectionCondition
extends AbstractCollectionElementCondition

An AbstractCollectionCondition implementation that checks whether none of the elements in a collection or array adhere to a specific condition.

Author:
Uri Boness

Constructor Summary
NoneCollectionCondition(Condition elementCondition)
          Constructs a new NoneCollectionCondition with a given condition.
 
Method Summary
protected  boolean checkArray(Object array)
          Checks whether none of the object in the given array adheres to the associated condition.
protected  boolean checkCollection(Collection collection)
          Checks whether none of the elements in the given collection adheres to the associated condition.
 
Methods inherited from class org.springmodules.validation.util.condition.collection.AbstractCollectionElementCondition
getElementCondition
 
Methods inherited from class org.springmodules.validation.util.condition.collection.AbstractCollectionCondition
beforeObjectChecked, doCheck
 
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

NoneCollectionCondition

public NoneCollectionCondition(Condition elementCondition)
Constructs a new NoneCollectionCondition with a given condition.

Parameters:
elementCondition - The condition to be checked on the collection/array elements.
Method Detail

checkArray

protected boolean checkArray(Object array)
Checks whether none of the object in the given array adheres to the associated condition.

Specified by:
checkArray in class AbstractCollectionCondition
Parameters:
array - The array to be checked.
Returns:
true none of the objects in the given array adheres to the associated condition, false otherwise.

checkCollection

protected boolean checkCollection(Collection collection)
Checks whether none of the elements in the given collection adheres to the associated condition.

Specified by:
checkCollection in class AbstractCollectionCondition
Parameters:
collection - The collection to be checked.
Returns:
true if none of the elements in the given collection adheres to the associated condition, false otherwise.


Copyright © 2009. All Rights Reserved.