Class BindingModel

java.lang.Object
org.springframework.validation.AbstractErrors
org.springframework.webflow.mvc.view.BindingModel
All Implemented Interfaces:
Serializable, org.springframework.validation.BindingResult, org.springframework.validation.Errors

public class BindingModel extends org.springframework.validation.AbstractErrors implements org.springframework.validation.BindingResult
Makes the properties of the "model" object available to Spring views during rendering. Also makes data binding (aka mapping) results available after a form postback attempt. Also makes error messages available to the view. This class is a Spring Errors adapter, basically, for use with spring form and bind tags.
Author:
Keith Donald, Jeremy Grelle, Phillip Webb
See Also:
  • Constructor Details

    • BindingModel

      public BindingModel(String objectName, Object boundObject, ExpressionParser expressionParser, ConversionService conversionService, MessageContext messageContext)
      Creates a new Spring Binding model.
      Parameters:
      objectName - the name of the bound model object
      boundObject - the bound model object
      expressionParser - the expression parser used to access model object properties
      conversionService - the registry used to access converters for formatting properties
      messageContext - the message context containing flow messages to display
  • Method Details

    • setMappingResults

      public void setMappingResults(MappingResults results)
      Sets the results of a data mapping attempt onto the bound model object from the view.
      Parameters:
      results -
      See Also:
    • setBinderConfiguration

      public void setBinderConfiguration(BinderConfiguration binderConfiguration)
    • getAllErrors

      public List<org.springframework.validation.ObjectError> getAllErrors()
      Specified by:
      getAllErrors in interface org.springframework.validation.Errors
      Overrides:
      getAllErrors in class org.springframework.validation.AbstractErrors
    • getGlobalErrors

      public List<org.springframework.validation.ObjectError> getGlobalErrors()
      Specified by:
      getGlobalErrors in interface org.springframework.validation.Errors
    • getFieldErrors

      public List<org.springframework.validation.FieldError> getFieldErrors(String field)
      Specified by:
      getFieldErrors in interface org.springframework.validation.Errors
      Overrides:
      getFieldErrors in class org.springframework.validation.AbstractErrors
    • getFieldType

      public Class<?> getFieldType(String field)
      Specified by:
      getFieldType in interface org.springframework.validation.Errors
      Overrides:
      getFieldType in class org.springframework.validation.AbstractErrors
    • getFieldValue

      public Object getFieldValue(String field)
      Specified by:
      getFieldValue in interface org.springframework.validation.Errors
    • getFieldErrors

      public List<org.springframework.validation.FieldError> getFieldErrors()
      Specified by:
      getFieldErrors in interface org.springframework.validation.Errors
    • getObjectName

      public String getObjectName()
      Specified by:
      getObjectName in interface org.springframework.validation.Errors
    • addAllErrors

      public void addAllErrors(org.springframework.validation.Errors errors)
      Specified by:
      addAllErrors in interface org.springframework.validation.Errors
    • reject

      public void reject(String errorCode, Object[] errorArgs, String defaultMessage)
      Specified by:
      reject in interface org.springframework.validation.Errors
    • rejectValue

      public void rejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage)
      Specified by:
      rejectValue in interface org.springframework.validation.Errors
    • getTarget

      public Object getTarget()
      Specified by:
      getTarget in interface org.springframework.validation.BindingResult
    • getRawFieldValue

      public Object getRawFieldValue(String field)
      Specified by:
      getRawFieldValue in interface org.springframework.validation.BindingResult
    • findEditor

      public PropertyEditor findEditor(String field, Class<?> valueType)
      Specified by:
      findEditor in interface org.springframework.validation.BindingResult
    • addError

      public void addError(org.springframework.validation.ObjectError error)
      Specified by:
      addError in interface org.springframework.validation.BindingResult
    • getModel

      public Map<String,Object> getModel()
      Specified by:
      getModel in interface org.springframework.validation.BindingResult
    • getPropertyEditorRegistry

      public org.springframework.beans.PropertyEditorRegistry getPropertyEditorRegistry()
      Specified by:
      getPropertyEditorRegistry in interface org.springframework.validation.BindingResult
    • getSuppressedFields

      public String[] getSuppressedFields()
      Specified by:
      getSuppressedFields in interface org.springframework.validation.BindingResult
    • recordSuppressedField

      public void recordSuppressedField(String field)
      Specified by:
      recordSuppressedField in interface org.springframework.validation.BindingResult
    • resolveMessageCodes

      public String[] resolveMessageCodes(String errorCode, String field)
      Specified by:
      resolveMessageCodes in interface org.springframework.validation.BindingResult
    • resolveMessageCodes

      public String[] resolveMessageCodes(String errorCode)
      Specified by:
      resolveMessageCodes in interface org.springframework.validation.BindingResult