org.springframework.rules.constraint.property
Class PropertiesConstraint
java.lang.Object
org.springframework.rules.constraint.property.AbstractPropertyConstraint
org.springframework.rules.constraint.property.PropertiesConstraint
- All Implemented Interfaces:
- Constraint, PropertyConstraint
public class PropertiesConstraint
- extends AbstractPropertyConstraint
A constraint that returns the result of a boolean
expression that tests two variable bean property values. For example,
pet.ageAtFirstVisit > pet.currentAge
- Author:
- Keith Donald
PropertiesConstraint
public PropertiesConstraint(String propertyName,
BinaryConstraint beanPropertyExpression,
String otherPropertyName)
- Creates a BeanPropertyExpression
- Parameters:
propertyName
- The first property participating in the expression.beanPropertyExpression
- The expression predicate that will test the two bean property
values.otherPropertyName
- The second property participating in the expression.
isCompoundRule
public boolean isCompoundRule()
- Description copied from interface:
PropertyConstraint
- Does this property constraint effect more than one property?
- Specified by:
isCompoundRule
in interface PropertyConstraint
- Overrides:
isCompoundRule
in class AbstractPropertyConstraint
- Returns:
- true if yes, false otherwise
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
getOtherPropertyName
public String getOtherPropertyName()
getConstraint
public BinaryConstraint getConstraint()
test
protected boolean test(PropertyAccessStrategy domainObjectAccessStrategy)
- Specified by:
test
in class AbstractPropertyConstraint
toString
public String toString()
- Overrides:
toString
in class AbstractPropertyConstraint
Copyright © 2004-2009 The Spring Framework. All Rights Reserved.