org.springframework.rules.constraint
Class XOr

java.lang.Object
  extended by org.springframework.core.closure.support.AlgorithmsAccessor
      extended by org.springframework.rules.constraint.ConstraintsAccessor
          extended by org.springframework.rules.constraint.AbstractConstraint
              extended by org.springframework.rules.constraint.CompoundConstraint
                  extended by org.springframework.rules.constraint.XOr
All Implemented Interfaces:
Serializable, Constraint

public class XOr
extends CompoundConstraint

A "xor" compound constraint (aka exclusive disjunction).

Author:
Mathias Broekelmann
See Also:
Serialized Form

Constructor Summary
XOr()
          Creates a empty UnaryOr disjunction.
XOr(Constraint[] constraints)
          "Ors" the specified constraints.
XOr(Constraint constraint1, Constraint constraint2)
          "Ors" two constraints.
 
Method Summary
 boolean test(Object value)
          Tests if any of the constraints aggregated by this compound constraint test true.
 
Methods inherited from class org.springframework.rules.constraint.CompoundConstraint
add, addAll, copyInto, get, indexOf, iterator, remove, set, size, toString, validateTypeSafety
 
Methods inherited from class org.springframework.rules.constraint.AbstractConstraint
allTrue, allTrue, anyTrue, anyTrue, findAll, findAll, findFirst, findFirst
 
Methods inherited from class org.springframework.rules.constraint.ConstraintsAccessor
all, all, and, any, any, bind, bind, bind, bind, bind, conjunction, disjunction, eq, eq, eq, eq, eq, eqProperty, eqProperty, getConstraints, gt, gt, gt, gt, gt, gt, gt, gte, gte, gte, gte, gte, gte, gte, gteProperty, gteProperty, gtProperty, gtProperty, ifTrue, ifTrueElse, inGroup, inGroup, inGroup, inRange, inRange, inRangeProperties, inRangeProperties, like, like, lt, lt, lt, lt, lt, lt, lt, lte, lte, lte, lte, lte, lte, lte, lteProperty, lteProperty, ltProperty, ltProperty, maxLength, method, minLength, not, not, or, present, present, range, range, range, range, range, range, range, regexp, regexp, required, required, testResultOf, unique, value
 
Methods inherited from class org.springframework.core.closure.support.AlgorithmsAccessor
allTrue, allTrue, anyTrue, anyTrue, findAll, findAll, findFirst, findFirst, forEach, forEach, getAlgorithms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XOr

public XOr()
Creates a empty UnaryOr disjunction.


XOr

public XOr(Constraint constraint1,
           Constraint constraint2)
"Ors" two constraints.

Parameters:
constraint1 - The first constraint.
constraint2 - The second constraint.

XOr

public XOr(Constraint[] constraints)
"Ors" the specified constraints.

Parameters:
constraints - The constraints
Method Detail

test

public boolean test(Object value)
Tests if any of the constraints aggregated by this compound constraint test true.

Specified by:
test in interface Constraint
Specified by:
test in class CompoundConstraint
Parameters:
value - the argument value
Returns:
true if the condition was satisfied, false otherwise
See Also:
Constraint.test(java.lang.Object)


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.