Top Description Constructors Methods
org.springframework.ui

public Class ExtendedModelMap

extends ModelMap
implements Model
Class Inheritance
All Implemented Interfaces
org.springframework.ui.Model
Known Direct Subclasses
org.springframework.validation.support.BindingAwareModelMap
Annotations
@SuppressWarnings:serial
Imports
java.util.Collection, .Map, org.springframework.lang.Nullable

Subclass of ModelMap that implements the Model interface.

This is an implementation class exposed to handler methods by Spring MVC, typically via 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.1

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ExtendedModelMap
addAllAttributes(Collection<?> attributeValues)

Overrides org.springframework.ui.ModelMap.addAllAttributes.

Implements org.springframework.ui.Model.addAllAttributes.

Copy all attributes in the supplied Collection into this Map, using attribute name generation for each element.
public ExtendedModelMap
addAllAttributes(Map<String, ?> attributes)

Overrides org.springframework.ui.ModelMap.addAllAttributes.

Implements org.springframework.ui.Model.addAllAttributes.

Copy all attributes in the supplied Map into this Map.
public ExtendedModelMap
addAttribute(String
the name of the model attribute (never null)
attributeName
,
Object
the model attribute value (can be null)
attributeValue
)

Overrides org.springframework.ui.ModelMap.addAttribute.

Implements org.springframework.ui.Model.addAttribute.

Add the supplied attribute under the supplied name.
public ExtendedModelMap
addAttribute(Object
the model attribute value (never null)
attributeValue
)

Overrides org.springframework.ui.ModelMap.addAttribute.

Implements org.springframework.ui.Model.addAttribute.

Add the supplied attribute to this Map using a generated name.
public Map<String, Object>
asMap()

Implements org.springframework.ui.Model.asMap.

Return the current set of model attributes as a Map.
public ExtendedModelMap
mergeAttributes(Map<String, ?> attributes)

Overrides org.springframework.ui.ModelMap.mergeAttributes.

Implements org.springframework.ui.Model.mergeAttributes.

Copy all attributes in the supplied Map into this Map, with existing objects of the same name taking precedence (i.e. not getting replaced).
Inherited from org.springframework.ui.ModelMap:
containsAttributegetAttribute

Constructor Detail

ExtendedModelMapback to summary
public ExtendedModelMap()

Method Detail

addAllAttributesback to summary
public ExtendedModelMap addAllAttributes(Collection<?> attributeValues)

Overrides org.springframework.ui.ModelMap.addAllAttributes.

Implements org.springframework.ui.Model.addAllAttributes.

Doc from org.springframework.ui.Model.addAllAttributes.

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

Annotations
@Override
addAllAttributesback to summary
public ExtendedModelMap addAllAttributes(Map<String, ?> attributes)

Overrides org.springframework.ui.ModelMap.addAllAttributes.

Implements org.springframework.ui.Model.addAllAttributes.

Doc from org.springframework.ui.Model.addAllAttributes.

Copy all attributes in the supplied Map into this Map.

Annotations
@Override
addAttributeback to summary
public ExtendedModelMap addAttribute(String attributeName, Object attributeValue)

Overrides org.springframework.ui.ModelMap.addAttribute.

Implements org.springframework.ui.Model.addAttribute.

Doc from org.springframework.ui.Model.addAttribute.

Add the supplied attribute under the supplied name.

Parameters
attributeName:String

the name of the model attribute (never null)

attributeValue:Object

the model attribute value (can be null)

Annotations
@Override
addAttributeback to summary
public ExtendedModelMap addAttribute(Object attributeValue)

Overrides org.springframework.ui.ModelMap.addAttribute.

Implements org.springframework.ui.Model.addAttribute.

Doc from org.springframework.ui.Model.addAttribute.

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:Object

the model attribute value (never null)

Annotations
@Override
asMapback to summary
public Map<String, Object> asMap()

Implements org.springframework.ui.Model.asMap.

Doc from org.springframework.ui.Model.asMap.

Return the current set of model attributes as a Map.

Annotations
@Override
mergeAttributesback to summary
public ExtendedModelMap mergeAttributes(Map<String, ?> attributes)

Overrides org.springframework.ui.ModelMap.mergeAttributes.

Implements org.springframework.ui.Model.mergeAttributes.

Doc from org.springframework.ui.Model.mergeAttributes.

Copy all attributes in the supplied Map into this Map, with existing objects of the same name taking precedence (i.e. not getting replaced).

Annotations
@Override