org.iscreen
Interface ValidatorContext

All Known Implementing Classes:
DefaultValidatorContext

public interface ValidatorContext

During validation, a Validator is given a reference to the context in which it is validating. The primary purpose of this context is to provide a means for the Validator to report validation failures. In the future, additional APIs will be added to support additional contextual information for use by the Validator.

Author:
Shellman, Dan

Method Summary
 java.util.Locale getLocale()
          Gets the current locale being used for this validation.
 void reportFailure(FailureMessage messageObject)
          Called to report a validation failure.
 void reportFailure(FailureMessage messageObject, java.lang.Object failureObject)
          Called to report a validation failure.
 void reportWarning(FailureMessage messageObject)
          Called to report a validation warning.
 void reportWarning(FailureMessage messageObject, java.lang.Object failureObject)
          Called to report a validation warning.
 

Method Detail

reportFailure

void reportFailure(FailureMessage messageObject)
Called to report a validation failure. The Object provided is the failure message (usually configured as a setter on the individual Validator).

Parameters:
messageObject - The message failure object representing the failure.

reportFailure

void reportFailure(FailureMessage messageObject,
                   java.lang.Object failureObject)
Called to report a validation failure. The Object provided is the failure message (usually configured as a setter on the individual Validator). The additional failure object is used to help generate the actual failure message (it becomes accessible to the message via the OGNL root).

Parameters:
messageObject - The message failure object representing the failure.
failureObject - A Validator-specific failure object to be made accessible to the message via the OGNL root.

reportWarning

void reportWarning(FailureMessage messageObject)
Called to report a validation warning. The Object provided is the failure message (usually configured as a setter on the individual Validator). A warning is handled as a separate exception that allows the user of this API to differentiate between validation failures and warnings.

Parameters:
messageObject - The message failure object representing the warning.

reportWarning

void reportWarning(FailureMessage messageObject,
                   java.lang.Object failureObject)
Called to report a validation warning. The Object provided is the failure message (usually configured as a setter on the individual Validator). The additional failure object is used to help generate the actual failure message (it becomes accessible to the message via the OGNL root). A warning is handled as a separate exception that allows the user of this API to differentiate between validation failures and warnings.

Parameters:
messageObject - The message failure object representing the warning.
failureObject - A Validator-specific failure object to be made accessible to the message via the OGNL root.

getLocale

java.util.Locale getLocale()
Gets the current locale being used for this validation.

Returns:
Returns the current locale being used.