|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springmodules.validation.bean.rule.DefaultValidationRule
public class DefaultValidationRule
The default implementation of the ValidationRule
interface. This implementation uses an applicability condition
to determine whether this rule is applicable on a given object (see ValidationRule.isApplicable(Object)
).
Constructor Summary | |
---|---|
DefaultValidationRule()
Empty contructor (javabean support). |
|
DefaultValidationRule(Condition condition,
Condition applicabilityCondition,
String errorCode)
Constructs a new DefaultValidationRule with given condition and error code. |
|
DefaultValidationRule(Condition condition,
Condition applicabilityCondition,
String errorCode,
Object[] errorArguments)
Constructs a new DefaultValidationRule with given condition, error code, and error arguments. |
|
DefaultValidationRule(Condition condition,
Condition applicabilityCondition,
String errorCode,
String defalutErrorMessage,
ErrorArgumentsResolver errorArgumentsResolver)
Constructs a new DefaultValidationRule with given condition, error code, error arguments resolver, and default error message. |
|
DefaultValidationRule(Condition condition,
Condition applicabilityCondition,
String errorCode,
String defalutErrorMessage,
Object[] errorArguments)
Constructs a new DefaultValidationRule with given condition, error code, error arguments, and default error message. |
|
DefaultValidationRule(Condition condition,
String errorCode)
Constructs a new DefaultValidationRule with the given condition and error code. |
|
DefaultValidationRule(Condition condition,
String errorCode,
Object[] errorArguments)
Constructs a new DefaultValidationRule with the given condition, error code, and error arguments. |
|
DefaultValidationRule(Condition condition,
String errorCode,
String defalutErrorMessage,
Object[] errorArguments)
Constructs a new DefaultValidationRule with the given condition and error information. |
Method Summary | |
---|---|
Condition |
getApplicabilityCondition()
Returns the applicability condition of this validation rule. |
Condition |
getCondition()
see ValidationRule.getCondition() |
String |
getDefaultErrorMessage()
See ValidationRule.getDefaultErrorMessage() . |
Object[] |
getErrorArguments(Object obj)
See ValidationRule.getErrorArguments(Object) |
String |
getErrorCode()
See ValidationRule.getErrorCode() |
boolean |
isApplicable(Object obj)
see ValidationRule.isApplicable(Object) . |
void |
setApplicabilityCondition(Condition applicabilityCondition)
Sets the applicability condition of this validation rule. see getApplicabilityCondition() . |
void |
setCondition(Condition condition)
Sets the condition of this validation rule. see getCondition() . |
void |
setDefalutErrorMessage(String defalutErrorMessage)
Sets the default error message to be used in case no error message is associated with the error code of this validation rule. |
void |
setErrorArguments(Object[] errorArguments)
Sets the arguments to attach to the error code of this validation rule. see getErrorArguments(Object) . |
void |
setErrorArgumentsResolver(ErrorArgumentsResolver errorArgumentsResolver)
Sets the error arguments resolver to be used by this validation rule to resolve the error arguments. |
void |
setErrorCode(String errorCode)
Sets the error code of this validation rule. see getErrorCode() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultValidationRule()
public DefaultValidationRule(Condition condition, String errorCode)
condition
- The condition of this validation rule.errorCode
- The error code of this validation rule.public DefaultValidationRule(Condition condition, String errorCode, Object[] errorArguments)
condition
- The condition of this validation rule.errorCode
- The error code of this validation rule.errorArguments
- The error arguments of this validation rule.public DefaultValidationRule(Condition condition, String errorCode, String defalutErrorMessage, Object[] errorArguments)
condition
- The condition of this validation rule.errorCode
- The error code of this validation rule.defalutErrorMessage
- The default error message of this validation rule.errorArguments
- The error arguments of this validation rule.public DefaultValidationRule(Condition condition, Condition applicabilityCondition, String errorCode)
condition
- The condition of this validation rule.applicabilityCondition
- Determines whether this rule is applicable on a given object.errorCode
- The error code of this validation rule.public DefaultValidationRule(Condition condition, Condition applicabilityCondition, String errorCode, Object[] errorArguments)
condition
- The condition of this validation rule.applicabilityCondition
- Determines whether this rule is applicable on a given object.errorCode
- The error code of this validation rule.errorArguments
- The error arguments of this validation rule.public DefaultValidationRule(Condition condition, Condition applicabilityCondition, String errorCode, String defalutErrorMessage, Object[] errorArguments)
condition
- The condition of this validation rule.applicabilityCondition
- Determines whether this rule is applicable on a given object.errorCode
- The error code of this validation rule.defalutErrorMessage
- The default error message of this validation rule.errorArguments
- The error arguments of this validation rule.public DefaultValidationRule(Condition condition, Condition applicabilityCondition, String errorCode, String defalutErrorMessage, ErrorArgumentsResolver errorArgumentsResolver)
condition
- The condition of this validation rule.applicabilityCondition
- Determines whether this rule is applicable on a given object.errorCode
- The error code of this validation rule.defalutErrorMessage
- The default error message of this validation rule.errorArgumentsResolver
- The resolver that will be used to resolve the error arguments.Method Detail |
---|
public boolean isApplicable(Object obj)
ValidationRule.isApplicable(Object)
.
The applicability of this validation rule is determined by the applicability condition.
see getApplicabilityCondition()
.
isApplicable
in interface ValidationRule
obj
- The object to be validated
public Condition getCondition()
ValidationRule.getCondition()
getCondition
in interface ValidationRule
public void setCondition(Condition condition)
getCondition()
.
condition
- The condition of this validation rule.public String getErrorCode()
ValidationRule.getErrorCode()
getErrorCode
in interface ValidationRule
public void setErrorCode(String errorCode)
getErrorCode()
.
errorCode
- The error code of this validation rule.public Object[] getErrorArguments(Object obj)
ValidationRule.getErrorArguments(Object)
getErrorArguments
in interface ValidationRule
obj
- The validated object.
public void setErrorArguments(Object[] errorArguments)
getErrorArguments(Object)
.
errorArguments
- The arguments to attach to the error code of this validation rule.public void setErrorArgumentsResolver(ErrorArgumentsResolver errorArgumentsResolver)
errorArgumentsResolver
- The given error arguments resolver.public String getDefaultErrorMessage()
ValidationRule.getDefaultErrorMessage()
.
getDefaultErrorMessage
in interface ValidationRule
public void setDefalutErrorMessage(String defalutErrorMessage)
getDefaultErrorMessage()
.
defalutErrorMessage
- The default error message of this validation rule.public Condition getApplicabilityCondition()
public void setApplicabilityCondition(Condition applicabilityCondition)
getApplicabilityCondition()
.
applicabilityCondition
- The applicability condition of this validation rule.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |