|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mod4j.runtime.validation.BusinessRuleValidationTemplate
public class BusinessRuleValidationTemplate
Template class that simplifies business rule validation. The central method is execute(org.mod4j.runtime.validation.BusinessRuleValidationCallback), supporting
validations implementing the BusinessRuleValidationCallback interface. It provides for the creation of an
Errors object for storing all errors found while validating fields of a particular object in the
BusinessRuleValidationCallback.doValidate(Object, Errors) method. After all validations are executed and the
results collected in the Errors object and if one or more errors are found, a BusinessRuleException
is thrown that wraps the the BindException object that implements the Errors object is thrown as an
exception.
| Constructor Summary | |
|---|---|
BusinessRuleValidationTemplate(java.lang.Object object)
Creates a new BusinessRuleValidationTemplate instance. |
|
| Method Summary | |
|---|---|
void |
execute(BusinessRuleValidationCallback action)
Execute the BusinessRuleValidationCallback.doValidate(Object, Errors) method of the given
action on the current object. |
void |
invokeValidator(org.springframework.validation.Validator validator)
Invoke the given validator on the current object. |
void |
invokeValidators(java.util.List<org.springframework.validation.Validator> validators)
Invoke the given validators on the current object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BusinessRuleValidationTemplate(java.lang.Object object)
object.
object - | Method Detail |
|---|
public void invokeValidator(org.springframework.validation.Validator validator)
validator on the current object.
validator -
BusinessRuleException - when the validator finds an error.public void invokeValidators(java.util.List<org.springframework.validation.Validator> validators)
validators on the current object.
validators - -
the validators to invoke.
BusinessRuleException - -
thrown when one of the validators finds an error.public void execute(BusinessRuleValidationCallback action)
BusinessRuleValidationCallback.doValidate(Object, Errors) method of the given
action on the current object.
action - -
the BusinessRuleValidationCallback to invoke its
BusinessRuleValidationCallback.doValidate(Object, Errors) method on.
BusinessRuleException - -
thrown when the BusinessRuleValidationCallback.doValidate(Object, Errors) method added one
ore more errors to its errors object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||