|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springmodules.validation.bean.rule.PropertyValidationRule
public class PropertyValidationRule
A ValidationRule
implementation that wraps another validation rule and is associated with a specific
property name. This validation rule is applicable on an object only if the object has the associated property and
if wrapped rule is applicable on the value of that property. The condition of the rule is condition of the wrapped
rule applied on the value of the associated property of the object.
Nested Class Summary | |
---|---|
protected static class |
PropertyValidationRule.DefaultApplicabilityCondition
|
Constructor Summary | |
---|---|
PropertyValidationRule()
Constructs a new PropertyValidationRule (javabean support). |
|
PropertyValidationRule(String propertyName,
ValidationRule rule)
Constructs a new PropertyValidationRule with a given property and a wrapped validation rule. |
Method Summary | |
---|---|
protected static boolean |
checkContext(String[] tokens)
|
Condition |
getCondition()
Returns the conditoin of this validation rule. |
String |
getDefaultErrorMessage()
Returns the default error message of this validation rule. |
Object[] |
getErrorArguments(Object obj)
Returns the arguments for the error of this validation rule. |
String |
getErrorCode()
Returns the error code of this condition. |
boolean |
isApplicable(Object obj)
Determines whether this rule is applicable on the given object. |
void |
setApplicabilityCondition(Condition applicabilityCondition)
|
void |
setContextTokens(String[] contextTokens)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyValidationRule()
public PropertyValidationRule(String propertyName, ValidationRule rule)
propertyName
- The name of the associated property.rule
- The validation rule to be wrapped.Method Detail |
---|
public boolean isApplicable(Object obj)
isApplicable
in interface ValidationRule
obj
- The object to be validated.
true
if this rule is applicable on the given object, false
otherwise.ValidationRule.isApplicable(Object)
public Condition getCondition()
getCondition
in interface ValidationRule
ValidationRule.getCondition()
public String getErrorCode()
getErrorCode
in interface ValidationRule
public Object[] getErrorArguments(Object obj)
getErrorArguments
in interface ValidationRule
obj
- The validated object.
public String getDefaultErrorMessage()
getDefaultErrorMessage
in interface ValidationRule
public void setApplicabilityCondition(Condition applicabilityCondition)
public void setContextTokens(String[] contextTokens)
protected static boolean checkContext(String[] tokens)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |