org.springframework.rules.constraint.property
Class PropertyInGroupConstraint
java.lang.Object
org.springframework.rules.constraint.property.AbstractPropertyConstraint
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
groupPropertyName
public final String groupPropertyName
PropertyInGroupConstraint
public PropertyInGroupConstraint(String propertyName,
String groupPropertyName)
- Parameters:
propertyName
- the property which contains the value to test against
the group valuesgroupPropertyName
- the property which contains the group values
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.