org.springframework.rules.constraint.property
Class UniquePropertyValueConstraint

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.property.UniquePropertyValueConstraint
All Implemented Interfaces:
Serializable, Constraint, PropertyConstraint

public class UniquePropertyValueConstraint
extends AbstractConstraint
implements PropertyConstraint

See Also:
Serialized Form

Constructor Summary
UniquePropertyValueConstraint(String propertyName)
           
 
Method Summary
protected  MutablePropertyAccessStrategy createPropertyAccessStrategy(Object o)
           
 String getPropertyName()
          Returns the constrained property name.
 boolean isCompoundRule()
          Does this property constraint effect more than one property?
 boolean isDependentOn(String propertyName)
          Returns true if this property constraint is dependent on the provided propertyName for test evaluation; that is, it should be retested when propertyName changes.
 boolean test(Object o)
          Returns true if each domain object in the provided collection has a unique value for the configured property.
 
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, toString, wait, wait, wait
 

Constructor Detail

UniquePropertyValueConstraint

public UniquePropertyValueConstraint(String propertyName)
Method Detail

getPropertyName

public String getPropertyName()
Description copied from interface: PropertyConstraint
Returns the constrained property name.

Specified by:
getPropertyName in interface PropertyConstraint
Returns:
The property name

isDependentOn

public boolean isDependentOn(String propertyName)
Description copied from interface: PropertyConstraint
Returns true if this property constraint is dependent on the provided propertyName for test evaluation; that is, it should be retested when propertyName changes.

Specified by:
isDependentOn in interface PropertyConstraint
Returns:
true or false

isCompoundRule

public boolean isCompoundRule()
Description copied from interface: PropertyConstraint
Does this property constraint effect more than one property?

Specified by:
isCompoundRule in interface PropertyConstraint
Returns:
true if yes, false otherwise

test

public boolean test(Object o)
Returns true if each domain object in the provided collection has a unique value for the configured property.

Specified by:
test in interface Constraint
Parameters:
o - the argument value
Returns:
true if the condition was satisfied, false otherwise

createPropertyAccessStrategy

protected MutablePropertyAccessStrategy createPropertyAccessStrategy(Object o)


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