public class

ExtendedModelMap

extends ModelMap
implements Model
java.lang.Object
   ↳ java.util.AbstractMap<K, V>
     ↳ java.util.HashMap<K, V>
       ↳ java.util.LinkedHashMap<K, V>
         ↳ org.springframework.ui.ModelMap
           ↳ org.springframework.ui.ExtendedModelMap
Known Direct Subclasses

Class Overview

Subclass of ModelMap that implements the Model interface. Java 5 specific like the Model interface itself.

Summary

Public Constructors
ExtendedModelMap()
Public Methods
ExtendedModelMap addAllAttributes(Map<String, ?> attributes)
Copy all attributes in the supplied Map into this Map.
ExtendedModelMap addAllAttributes(Collection<?> attributeValues)
Copy all attributes in the supplied Collection into this Map, using attribute name generation for each element.
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<StringObject> 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.
[Expand]
Inherited Methods
From class org.springframework.ui.ModelMap
From class java.util.LinkedHashMap
From class java.util.HashMap
From class java.util.AbstractMap
From class java.lang.Object
From interface java.util.Map
From interface org.springframework.ui.Model

Public Constructors

public ExtendedModelMap ()

Public Methods

public ExtendedModelMap addAllAttributes (Map<String, ?> attributes)

Copy all attributes in the supplied Map into this Map.

public ExtendedModelMap addAllAttributes (Collection<?> attributeValues)

Copy all attributes in the supplied Collection into this Map, using attribute name generation for each element.

public ExtendedModelMap addAttribute (Object attributeValue)

Add the supplied attribute to this Map using a generated name.

Note: Empty 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.

Parameters
attributeValue the model attribute value (never null)

public ExtendedModelMap addAttribute (String attributeName, Object attributeValue)

Add the supplied attribute under the supplied name.

Parameters
attributeName the name of the model attribute (never null)
attributeValue the model attribute value (can be null)

public Map<StringObject> asMap ()

Return the current set of model attributes as a Map.

public 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).