Class ValidationHelper
java.lang.Object
org.springframework.webflow.validation.ValidationHelper
A helper class the encapsulates conventions to invoke validation logic.
- Author:
- Scott Andrews, Canny Duck, Jeremy Grelle
- 
Constructor SummaryConstructorsConstructorDescriptionValidationHelper(Object model, RequestContext requestContext, String eventId, String modelName, ExpressionParser expressionParser, org.springframework.validation.MessageCodesResolver messageCodesResolver, MappingResults mappingResults) An alternative constructor that creates an instance ofBeanValidationHintResolver.ValidationHelper(Object model, RequestContext requestContext, String eventId, String modelName, ExpressionParser expressionParser, org.springframework.validation.MessageCodesResolver messageCodesResolver, MappingResults mappingResults, ValidationHintResolver hintResolver) Create a throwaway validation helper object.
- 
Method SummaryModifier and TypeMethodDescriptionvoidsetValidationHints(Object[] validationHints) Provide validation hints (e.g.voidsetValidator(org.springframework.validation.Validator validator) Configure aValidatorto apply to the model.voidvalidate()Invoke the validators available by convention.
- 
Constructor Details- 
ValidationHelperpublic ValidationHelper(Object model, RequestContext requestContext, String eventId, String modelName, ExpressionParser expressionParser, org.springframework.validation.MessageCodesResolver messageCodesResolver, MappingResults mappingResults, ValidationHintResolver hintResolver) Create a throwaway validation helper object. Validation is invoked by thevalidate()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)orcontext.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
 
- 
ValidationHelperpublic ValidationHelper(Object model, RequestContext requestContext, String eventId, String modelName, ExpressionParser expressionParser, org.springframework.validation.MessageCodesResolver messageCodesResolver, MappingResults mappingResults) An alternative constructor that creates an instance ofBeanValidationHintResolver.
 
- 
- 
Method Details- 
setValidatorpublic void setValidator(org.springframework.validation.Validator validator) Configure aValidatorto apply to the model.
- 
setValidationHintsProvide validation hints (e.g. JSR-303 validation groups). Note that the constructor automatically detects validation hints specified on a view state or a transition. Therefore use of this method should not be needed.
- 
validatepublic void validate()Invoke the validators available by convention.
 
-