com.opensymphony.webwork.portlet
Class PortletSessionMap
java.lang.Object
java.util.AbstractMap
com.opensymphony.webwork.portlet.PortletSessionMap
- All Implemented Interfaces:
- Serializable, Map
public class PortletSessionMap
- extends AbstractMap
- implements Serializable
A simple implementation of the Map
interface to handle a collection of portlet session
attributes. The entrySet()
method enumerates over all session attributes and creates a Set of entries.
Note, this will occur lazily - only when the entry set is asked for.
- Author:
- Nils-Helge Garli
- See Also:
- Serialized Form
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry |
Constructor Summary |
PortletSessionMap(javax.portlet.PortletRequest request)
Creates a new session map given a portlet request. |
Methods inherited from class java.util.AbstractMap |
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values |
PortletSessionMap
public PortletSessionMap(javax.portlet.PortletRequest request)
- Creates a new session map given a portlet request.
- Parameters:
request
- the portlet request object.
entrySet
public Set entrySet()
- Specified by:
entrySet
in interface Map
- Specified by:
entrySet
in class AbstractMap
- See Also:
Map.entrySet()
get
public Object get(Object key)
- Returns the session attribute associated with the given key or
null if it doesn't exist.
- Specified by:
get
in interface Map
- Overrides:
get
in class AbstractMap
- Parameters:
key
- the name of the session attribute.
- Returns:
- the session attribute or null if it doesn't exist.
put
public Object put(Object key,
Object value)
- Saves an attribute in the session.
- Specified by:
put
in interface Map
- Overrides:
put
in class AbstractMap
- Parameters:
key
- the name of the session attribute.value
- the value to set.
- Returns:
- the object that was just set.
clear
public void clear()
- Specified by:
clear
in interface Map
- Overrides:
clear
in class AbstractMap
- See Also:
Map.clear()
remove
public Object remove(Object key)
- Removes the specified session attribute.
- Specified by:
remove
in interface Map
- Overrides:
remove
in class AbstractMap
- Parameters:
key
- the name of the attribute to remove.
- Returns:
- the value that was removed or null if the value was
not found (and hence, not removed).