org.mod4j.runtime.validation
Class BusinessRuleValidationSupport

java.lang.Object
  extended by org.mod4j.runtime.validation.BusinessRuleValidationSupport

public class BusinessRuleValidationSupport
extends java.lang.Object

Author:
Eric Jan Malotaux

Field Summary
protected  BusinessRuleValidationTemplate validationTemplate
           
protected  java.util.List<org.springframework.validation.Validator> validators
           
 
Constructor Summary
BusinessRuleValidationSupport(java.lang.Object object)
           
 
Method Summary
 void addValidator(org.springframework.validation.Validator validator)
          Add the given validator to the collection of validators that will be executed on this object when the validate() method is called.
 boolean isActive()
           
 void setActive(boolean active)
           
 void validate()
          Validate this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

validators

protected java.util.List<org.springframework.validation.Validator> validators

validationTemplate

protected final BusinessRuleValidationTemplate validationTemplate
Constructor Detail

BusinessRuleValidationSupport

public BusinessRuleValidationSupport(java.lang.Object object)
Method Detail

isActive

public boolean isActive()

setActive

public void setActive(boolean active)

addValidator

public void addValidator(org.springframework.validation.Validator validator)
Add the given validator to the collection of validators that will be executed on this object when the validate() method is called. The validators will be invoked in the order they were added.

Parameters:
validator - - the validator being added.

validate

public void validate()
              throws BusinessRuleException
Validate this object. If active, validation is performed by calling every Validator added by the addValidator(Validator) method, in the order they were added.

Throws:
BusinessRuleException - - thrown when one or more errors are found. The exception thrown has as its cause a BindException containing information on all errors found.


Copyright © 2009. All Rights Reserved.