org.iscreen
Interface Validator

All Known Implementing Classes:
BaseValidator, DateFormatValidator, DateRangeValidator, NullValidator, RegularExpressionValidator, StringValidator

public interface Validator

Implementations of this interface are expected to validate a JavaBean's properties. The JavaBean to be validated is the one returned by the call to constructBeanToValidate(). The lifecycle of Validators (implementations of this interface) is as follows:

Author:
Shellman, Dan

Method Summary
 java.lang.Object constructBeanToValidate()
          This is called prior to calling the validate() method.
 void validate(ValidatorContext context, java.lang.Object beanToValidate)
          This is the method that's called to validate the "bean-to-validate." Use the passed in ValidatorContext to report validation failures, etc.
 

Method Detail

validate

void validate(ValidatorContext context,
              java.lang.Object beanToValidate)
This is the method that's called to validate the "bean-to-validate." Use the passed in ValidatorContext to report validation failures, etc. The passed-in "bean-to-validate" is the same instance returned from the call to constructBeanToValidate(), but with all of the appropriate properties set (based upon the configured mapping).

Parameters:
context - The ValidatorContext, which is used to report failures.
beanToValidate - The JavaBean to validate.

constructBeanToValidate

java.lang.Object constructBeanToValidate()
This is called prior to calling the validate() method. This method is meant to construct a JavaBean that will have properties mapped to it for use by the validator.

Returns:
Returns a JavaBean that will have properties mapped to it for use by the call to the validate() method.