|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.rules.constraint.property.ParameterizedPropertyConstraint
public class ParameterizedPropertyConstraint
A constraint that returns the result of a boolean
expression that tests a variable bean property value against a constant
parameter value. For example: pet.age > 5
Constructor Summary | |
---|---|
ParameterizedPropertyConstraint(String propertyName,
BinaryConstraint expression,
Object parameter)
Creates a BeanPropertyExpressionTester. |
|
ParameterizedPropertyConstraint(String propertyName,
Constraint parameterizedExpression)
|
Method Summary | |
---|---|
BinaryConstraint |
getConstraint()
|
Object |
getParameter()
|
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 bean)
Tests the value of the configured propertyName for this bean against the configured parameter value using the configured binary predicate. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ParameterizedPropertyConstraint(String propertyName, BinaryConstraint expression, Object parameter)
propertyName
- The property participating in the expression.expression
- The expression predicate (tester).parameter
- The constant parameter value participating in the expression.public ParameterizedPropertyConstraint(String propertyName, Constraint parameterizedExpression)
Method Detail |
---|
public String getPropertyName()
PropertyConstraint
getPropertyName
in interface PropertyConstraint
public boolean isDependentOn(String propertyName)
PropertyConstraint
true
if this property constraint is dependent on
the provided propertyName for test evaluation; that is, it should be retested
when propertyName changes.
isDependentOn
in interface PropertyConstraint
public boolean isCompoundRule()
PropertyConstraint
isCompoundRule
in interface PropertyConstraint
public BinaryConstraint getConstraint()
public Object getParameter()
public boolean test(Object bean)
test
in interface Constraint
bean
- the argument value
true
if the condition was satisfied,
false
otherwiseConstraint.test(java.lang.Object)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |