org.springframework.validation
Class MapBindingResult
java.lang.Object
org.springframework.validation.AbstractErrors
org.springframework.validation.AbstractBindingResult
org.springframework.validation.MapBindingResult
- All Implemented Interfaces:
- java.io.Serializable, BindingResult, Errors
public class MapBindingResult
- extends AbstractBindingResult
- implements java.io.Serializable
Map-based implementation of the BindingResult interface,
supporting registration and evaluation of binding errors on
Map attributes.
Can be used as errors holder for custom binding onto a
Map, for example when invoking a Validator for a Map object.
- Since:
- 2.0
- Author:
- Juergen Hoeller
- See Also:
Map
,
Serialized Form
Field Summary |
private java.util.Map |
target
|
Constructor Summary |
MapBindingResult(java.util.Map target,
java.lang.String objectName)
Create a new MapBindingResult instance. |
Method Summary |
protected java.lang.Object |
getActualFieldValue(java.lang.String field)
Extract the actual field value for the given field. |
java.lang.Object |
getTarget()
Return the wrapped target object. |
java.util.Map |
getTargetMap()
|
Methods inherited from class org.springframework.validation.AbstractBindingResult |
addAllErrors, addError, equals, findEditor, formatFieldValue, getAllErrors, getErrorCount, getFieldError, getFieldError, getFieldErrors, getFieldErrors, getFieldType, getFieldValue, getGlobalError, getGlobalErrors, getMessageCodesResolver, getModel, getObjectName, getPropertyEditorRegistry, getRawFieldValue, getSuppressedFields, hasErrors, hashCode, recordSuppressedField, reject, rejectValue, resolveMessageCodes, resolveMessageCodes, setMessageCodesResolver |
Methods inherited from class org.springframework.validation.AbstractErrors |
canonicalFieldName, doSetNestedPath, fixedField, getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, isMatchingFieldError, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.validation.Errors |
getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath |
target
private final java.util.Map target
MapBindingResult
public MapBindingResult(java.util.Map target,
java.lang.String objectName)
- Create a new MapBindingResult instance.
- Parameters:
target
- the target Map to bind ontoobjectName
- the name of the target object
getTargetMap
public final java.util.Map getTargetMap()
getTarget
public final java.lang.Object getTarget()
- Description copied from class:
AbstractBindingResult
- Return the wrapped target object.
- Specified by:
getTarget
in interface BindingResult
- Specified by:
getTarget
in class AbstractBindingResult
getActualFieldValue
protected java.lang.Object getActualFieldValue(java.lang.String field)
- Description copied from class:
AbstractBindingResult
- Extract the actual field value for the given field.
- Specified by:
getActualFieldValue
in class AbstractBindingResult
- Parameters:
field
- the field to check
- Returns:
- the current value of the field