Top Description Fields Constructors Methods
org.springframework.validation

public Class MapBindingResult

extends AbstractBindingResult
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Annotations
@SuppressWarnings:serial
Imports
java.io.Serializable, java.util.Map, org.springframework.lang.NonNull, .Nullable, org.springframework.util.Assert

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.

Author
Juergen Hoeller
Since
2.0
See Also
java.util.Map

Field Summary

Modifier and TypeField and Description
private final Map<?, ?>

Constructor Summary

AccessConstructor and Description
public
MapBindingResult(Map<?, ?>
the target Map to bind onto
target
,
String
the name of the target object
objectName
)

Create a new MapBindingResult instance.

Method Summary

Modifier and TypeMethod and Description
protected Object
getActualFieldValue(String
the field to check
field
)

Implements abstract org.springframework.validation.AbstractBindingResult.getActualFieldValue.

Extract the actual field value for the given field.
public final Object
public final Map<?, ?>
getTargetMap()

Return the target Map to bind onto.

Inherited from org.springframework.validation.AbstractBindingResult:
addAllErrorsaddErrorequalsfindEditorformatFieldValuegetAllErrorsgetErrorCountgetFieldErrorgetFieldErrorgetFieldErrorsgetFieldErrorsgetFieldTypegetFieldValuegetGlobalErrorgetGlobalErrorsgetMessageCodesResolvergetModelgetObjectNamegetPropertyEditorRegistrygetRawFieldValuegetSuppressedFieldshasErrorshashCoderecordFieldValuerecordSuppressedFieldrejectrejectValueresolveMessageCodesresolveMessageCodessetMessageCodesResolver

Field Detail

targetback to summary
private final Map<?, ?> target

Constructor Detail

MapBindingResultback to summary
public MapBindingResult(Map<?, ?> target, String objectName)

Create a new MapBindingResult instance.

Parameters
target:Map<?, ?>

the target Map to bind onto

objectName:String

the name of the target object

Method Detail

getActualFieldValueback to summary
protected Object getActualFieldValue(String field)

Implements abstract org.springframework.validation.AbstractBindingResult.getActualFieldValue.

Doc from org.springframework.validation.AbstractBindingResult.getActualFieldValue.

Extract the actual field value for the given field.

Parameters
field:String

the field to check

Returns:Object

the current value of the field

Annotations
@Override
@Nullable
getTargetback to summary
public final Object getTarget()

Implements abstract org.springframework.validation.AbstractBindingResult.getTarget.

Implements org.springframework.validation.BindingResult.getTarget.

Doc from org.springframework.validation.AbstractBindingResult.getTarget.

Return the wrapped target object.

Annotations
@Override
@NonNull
getTargetMapback to summary
public final Map<?, ?> getTargetMap()

Return the target Map to bind onto.