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:
-
Field Summary
Fields inherited from interface org.springframework.validation.BindingResult
MODEL_KEY_PREFIX
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR
-
Constructor Summary
ConstructorDescriptionBindingModel
(String objectName, Object boundObject, ExpressionParser expressionParser, ConversionService conversionService, MessageContext messageContext) Creates a new Spring Binding model. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllErrors
(org.springframework.validation.Errors errors) void
addError
(org.springframework.validation.ObjectError error) findEditor
(String field, Class<?> valueType) List<org.springframework.validation.ObjectError>
org.springframework.validation.FieldError
getFieldError
(String field) List<org.springframework.validation.FieldError>
List<org.springframework.validation.FieldError>
getFieldErrors
(String field) Class<?>
getFieldType
(String field) getFieldValue
(String field) List<org.springframework.validation.ObjectError>
getModel()
org.springframework.beans.PropertyEditorRegistry
getRawFieldValue
(String field) String[]
void
recordSuppressedField
(String field) void
void
rejectValue
(String field, String errorCode, Object[] errorArgs, String defaultMessage) String[]
resolveMessageCodes
(String errorCode) String[]
resolveMessageCodes
(String errorCode, String field) void
setBinderConfiguration
(BinderConfiguration binderConfiguration) void
setMappingResults
(MappingResults results) Sets the results of a data mapping attempt onto the bound model object from the view.Methods inherited from class org.springframework.validation.AbstractErrors
canonicalFieldName, doSetNestedPath, fixedField, getErrorCount, getFieldError, getFieldErrorCount, getFieldErrorCount, getGlobalError, getGlobalErrorCount, getNestedPath, hasErrors, hasFieldErrors, hasFieldErrors, hasGlobalErrors, isMatchingFieldError, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.validation.BindingResult
recordFieldValue
Methods inherited from interface org.springframework.validation.Errors
getErrorCount, getFieldError, getFieldErrorCount, getFieldErrorCount, getGlobalError, getGlobalErrorCount, getNestedPath, hasErrors, hasFieldErrors, hasFieldErrors, hasGlobalErrors, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath
-
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 objectboundObject
- the bound model objectexpressionParser
- the expression parser used to access model object propertiesconversionService
- the registry used to access converters for formatting propertiesmessageContext
- the message context containing flow messages to display
-
-
Method Details
-
setMappingResults
Sets the results of a data mapping attempt onto the bound model object from the view.- Parameters:
results
-- See Also:
-
setBinderConfiguration
-
getAllErrors
- Specified by:
getAllErrors
in interfaceorg.springframework.validation.Errors
- Overrides:
getAllErrors
in classorg.springframework.validation.AbstractErrors
-
getGlobalErrors
- Specified by:
getGlobalErrors
in interfaceorg.springframework.validation.Errors
-
getFieldErrors
- Specified by:
getFieldErrors
in interfaceorg.springframework.validation.Errors
- Overrides:
getFieldErrors
in classorg.springframework.validation.AbstractErrors
-
getFieldError
- Specified by:
getFieldError
in interfaceorg.springframework.validation.Errors
- Overrides:
getFieldError
in classorg.springframework.validation.AbstractErrors
-
getFieldType
- Specified by:
getFieldType
in interfaceorg.springframework.validation.Errors
- Overrides:
getFieldType
in classorg.springframework.validation.AbstractErrors
-
getFieldValue
- Specified by:
getFieldValue
in interfaceorg.springframework.validation.Errors
-
getFieldErrors
- Specified by:
getFieldErrors
in interfaceorg.springframework.validation.Errors
-
getObjectName
- Specified by:
getObjectName
in interfaceorg.springframework.validation.Errors
-
addAllErrors
public void addAllErrors(org.springframework.validation.Errors errors) - Specified by:
addAllErrors
in interfaceorg.springframework.validation.Errors
-
reject
- Specified by:
reject
in interfaceorg.springframework.validation.Errors
-
rejectValue
- Specified by:
rejectValue
in interfaceorg.springframework.validation.Errors
-
getTarget
- Specified by:
getTarget
in interfaceorg.springframework.validation.BindingResult
-
getRawFieldValue
- Specified by:
getRawFieldValue
in interfaceorg.springframework.validation.BindingResult
-
findEditor
- Specified by:
findEditor
in interfaceorg.springframework.validation.BindingResult
-
addError
public void addError(org.springframework.validation.ObjectError error) - Specified by:
addError
in interfaceorg.springframework.validation.BindingResult
-
getModel
- Specified by:
getModel
in interfaceorg.springframework.validation.BindingResult
-
getPropertyEditorRegistry
public org.springframework.beans.PropertyEditorRegistry getPropertyEditorRegistry()- Specified by:
getPropertyEditorRegistry
in interfaceorg.springframework.validation.BindingResult
-
getSuppressedFields
- Specified by:
getSuppressedFields
in interfaceorg.springframework.validation.BindingResult
-
recordSuppressedField
- Specified by:
recordSuppressedField
in interfaceorg.springframework.validation.BindingResult
-
resolveMessageCodes
- Specified by:
resolveMessageCodes
in interfaceorg.springframework.validation.BindingResult
-
resolveMessageCodes
- Specified by:
resolveMessageCodes
in interfaceorg.springframework.validation.BindingResult
-