Top Description Constructors Methods
org.springframework.validation.support

public Class BindingAwareModelMap

extends ExtendedModelMap
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.util.Map, org.springframework.lang.Nullable, org.springframework.ui.ExtendedModelMap, org.springframework.validation.BindingResult

Subclass of org.springframework.ui.ExtendedModelMap that automatically removes a org.springframework.validation.BindingResult object if the corresponding target attribute gets replaced through regular Map operations.

This is the class exposed to handler methods by Spring MVC, typically consumed through a declaration of the org.springframework.ui.Model interface. There is no need to build it within user code; a plain org.springframework.ui.ModelMap or even a just a regular Map with String keys will be good enough to return a user model.

Author
Juergen Hoeller
Since
2.5.6
See Also
org.springframework.validation.BindingResult

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
put(String
key with which the specified value is to be associated
key
,
Object
value to be associated with the specified key
value
)

Overrides java.util.HashMap.put.

Implements java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation).
public void
putAll(Map<? extends String, ?>
mappings to be stored in this map
map
)

Overrides java.util.HashMap.putAll.

Implements java.util.Map.putAll.

Copies all of the mappings from the specified map to this map (optional operation).
private void
Inherited from org.springframework.ui.ExtendedModelMap:
addAllAttributesaddAllAttributesaddAttributeaddAttributeasMapmergeAttributes

Constructor Detail

BindingAwareModelMapback to summary
public BindingAwareModelMap()

Method Detail

putback to summary
public Object put(String key, Object value)

Overrides java.util.HashMap.put.

Implements java.util.Map.put.

Doc from java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)

Parameters
key:String

key with which the specified value is to be associated

value:Object

value to be associated with the specified key

Returns:Object

the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key, if the implementation supports null values.)

Annotations
@Override
putAllback to summary
public void putAll(Map<? extends String, ?> map)

Overrides java.util.HashMap.putAll.

Implements java.util.Map.putAll.

Doc from java.util.Map.putAll.

Copies all of the mappings from the specified map to this map (optional operation). The effect of this call is equivalent to that of calling put(k, v) on this map once for each mapping from key k to value v in the specified map. The behavior of this operation is undefined if the specified map is modified while the operation is in progress. If the specified map has a defined encounter order, processing of its mappings generally occurs in that order.

Parameters
map:Map<? extends String, ?>

mappings to be stored in this map

Annotations
@Override
removeBindingResultIfNecessaryback to summary
private void removeBindingResultIfNecessary(Object key, Object value)