Spring Web Flow

org.springframework.webflow.validation
Class ValidationHelper

java.lang.Object
  extended by org.springframework.webflow.validation.ValidationHelper

public class ValidationHelper
extends java.lang.Object

A helper class the encapsulates conventions to invoke validation logic.

Author:
Scott Andrews, Canny Duck, Jeremy Grelle

Constructor Summary
ValidationHelper(java.lang.Object model, RequestContext requestContext, java.lang.String eventId, java.lang.String modelName, ExpressionParser expressionParser, org.springframework.validation.MessageCodesResolver messageCodesResolver, MappingResults mappingResults)
          Create a throwaway validation helper object.
 
Method Summary
 void setValidationHints(java.lang.Object[] validationHints)
          Provide validation hints such as validation groups to use against a JSR-303 provider.
 void setValidator(org.springframework.validation.Validator validator)
          Configure a Validator to apply to the model.
 void validate()
          Invoke the validators available by convention.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationHelper

public ValidationHelper(java.lang.Object model,
                        RequestContext requestContext,
                        java.lang.String eventId,
                        java.lang.String modelName,
                        ExpressionParser expressionParser,
                        org.springframework.validation.MessageCodesResolver messageCodesResolver,
                        MappingResults mappingResults)
Create a throwaway validation helper object. Validation is invoked by the validate() method.

Validation methods invoked include a validation method on the model object or a validator bean. The method name on either object is in the form of validate[viewStateId]. A ValidationContext is passed in the method signature along with the model object for validator beans. A MessageContext can be substituted for the ValidationContext.

For example: model.validateEnterBookingDetails(VaticationContext) or context.getBean("modelValidator").validateEnterBookingDetails(model, VaticationContext)

Parameters:
model - the object to validate
requestContext - the context for the request
eventId - the event triggering validation
modelName - the name of the model object
expressionParser - the expression parser
mappingResults - object mapping results
Method Detail

setValidator

public void setValidator(org.springframework.validation.Validator validator)
Configure a Validator to apply to the model.


setValidationHints

public void setValidationHints(java.lang.Object[] validationHints)
Provide validation hints such as validation groups to use against a JSR-303 provider.


validate

public void validate()
Invoke the validators available by convention.


Spring Web Flow