org.springframework.rules.constraint.property
Class PropertyInGroupConstraint

java.lang.Object
  extended by org.springframework.rules.constraint.property.AbstractPropertyConstraint
      extended by org.springframework.rules.constraint.property.PropertyInGroupConstraint
All Implemented Interfaces:
Constraint, PropertyConstraint

public class PropertyInGroupConstraint
extends AbstractPropertyConstraint

Property constraint which works like InGroup constraint but allows using a dynamic value list to determine if a property value is in a group of values.

To use it a second property field is required which contains the values for the 'in group' test

Author:
Mathias Broekelmann

Field Summary
 String groupPropertyName
           
 
Constructor Summary
PropertyInGroupConstraint(String propertyName, String groupPropertyName)
           
 
Method Summary
 String getGroupPropertyName()
           
 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.
protected  boolean test(PropertyAccessStrategy accessor)
           
 
Methods inherited from class org.springframework.rules.constraint.property.AbstractPropertyConstraint
getPropertyName, isCompoundRule, setPropertyName, test, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

groupPropertyName

public final String groupPropertyName
Constructor Detail

PropertyInGroupConstraint

public PropertyInGroupConstraint(String propertyName,
                                 String groupPropertyName)
Parameters:
propertyName - the property which contains the value to test against the group values
groupPropertyName - the property which contains the group values
Method Detail

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
Overrides:
isDependentOn in class AbstractPropertyConstraint
Returns:
true or false

getGroupPropertyName

public String getGroupPropertyName()

test

protected boolean test(PropertyAccessStrategy accessor)
Specified by:
test in class AbstractPropertyConstraint


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