org.apache.struts2.portlet
Class PortletRequestMap

java.lang.Object
  extended by java.util.AbstractMap
      extended by org.apache.struts2.portlet.PortletRequestMap
All Implemented Interfaces:
Map

public class PortletRequestMap
extends AbstractMap

A simple implementation of the Map interface to handle a collection of request attributes.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
private  Set<Object> entries
           
private static Log LOG
           
private  javax.portlet.PortletRequest request
           
 
Constructor Summary
PortletRequestMap(javax.portlet.PortletRequest request)
          Saves the request to use as the backing for getting and setting values
 
Method Summary
 void clear()
          Removes all attributes from the request as well as clears entries in this map.
 Set entrySet()
          Returns a Set of attributes from the portlet request.
 Object get(Object key)
          Returns the request attribute associated with the given key or null if it doesn't exist.
 Object put(Object key, Object value)
          Saves an attribute in the request.
 Object remove(Object key)
          Removes the specified request attribute.
 
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG

entries

private Set<Object> entries

request

private javax.portlet.PortletRequest request
Constructor Detail

PortletRequestMap

public PortletRequestMap(javax.portlet.PortletRequest request)
Saves the request to use as the backing for getting and setting values

Parameters:
request - the portlet request.
Method Detail

clear

public void clear()
Removes all attributes from the request as well as clears entries in this map.

Specified by:
clear in interface Map
Overrides:
clear in class AbstractMap

entrySet

public Set entrySet()
Returns a Set of attributes from the portlet request.

Specified by:
entrySet in interface Map
Specified by:
entrySet in class AbstractMap
Returns:
a Set of attributes from the portlet request.

get

public Object get(Object key)
Returns the request 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 request attribute.
Returns:
the request attribute or null if it doesn't exist.

put

public Object put(Object key,
                  Object value)
Saves an attribute in the request.

Specified by:
put in interface Map
Overrides:
put in class AbstractMap
Parameters:
key - the name of the request attribute.
value - the value to set.
Returns:
the object that was just set.

remove

public Object remove(Object key)
Removes the specified request 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).


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.