|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap
org.springframework.ui.ModelMap
org.springframework.ui.ExtendedModelMap
public class ExtendedModelMap
Subclass of ModelMap
that implements the Model
interface.
Java 5 specific like the Model
interface itself.
Constructor Summary | |
---|---|
ExtendedModelMap()
|
Method Summary | |
---|---|
ExtendedModelMap |
addAllAttributes(Collection<?> attributeValues)
Copy all attributes in the supplied Collection into this
Map , using attribute name generation for each element. |
ExtendedModelMap |
addAllAttributes(Map<String,?> attributes)
Copy all attributes in the supplied Map into this Map . |
ExtendedModelMap |
addAttribute(Object attributeValue)
Add the supplied attribute to this Map using a
generated name . |
ExtendedModelMap |
addAttribute(String attributeName,
Object attributeValue)
Add the supplied attribute under the supplied name. |
Map<String,Object> |
asMap()
Return the current set of model attributes as a Map. |
ExtendedModelMap |
mergeAttributes(Map<String,?> attributes)
Copy all attributes in the supplied Map into this Map ,
with existing objects of the same name taking precedence (i.e. not getting
replaced). |
Methods inherited from class org.springframework.ui.ModelMap |
---|
addAllAttributes, addAllAttributes, addAllObjects, addAllObjects, addObject, addObject, containsAttribute, mergeAttributes |
Methods inherited from class java.util.LinkedHashMap |
---|
clear, containsValue, get, removeEldestEntry |
Methods inherited from class java.util.HashMap |
---|
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.ui.Model |
---|
containsAttribute |
Methods inherited from interface java.util.Map |
---|
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Constructor Detail |
---|
public ExtendedModelMap()
Method Detail |
---|
public ExtendedModelMap addAttribute(String attributeName, Object attributeValue)
ModelMap
addAttribute
in interface Model
addAttribute
in class ModelMap
attributeName
- the name of the model attribute (never null
)attributeValue
- the model attribute value (can be null
)public ExtendedModelMap addAttribute(Object attributeValue)
ModelMap
Map
using a
generated name
.
Collections
are not added to
the model when using this method because we cannot correctly determine
the true convention name. View code should check for null
rather
than for empty collections as is already done by JSTL tags.
addAttribute
in interface Model
addAttribute
in class ModelMap
attributeValue
- the model attribute value (never null
)public ExtendedModelMap addAllAttributes(Collection<?> attributeValues)
Model
Collection
into this
Map
, using attribute name generation for each element.
addAllAttributes
in interface Model
Model.addAttribute(Object)
public ExtendedModelMap addAllAttributes(Map<String,?> attributes)
Model
Map
into this Map
.
addAllAttributes
in interface Model
Model.addAttribute(String, Object)
public ExtendedModelMap mergeAttributes(Map<String,?> attributes)
Model
Map
into this Map
,
with existing objects of the same name taking precedence (i.e. not getting
replaced).
mergeAttributes
in interface Model
public Map<String,Object> asMap()
Model
asMap
in interface Model
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |