jodd.servlet
Class HttpServletContextMap

java.lang.Object
  extended by java.util.AbstractMap<java.lang.String,java.lang.Object>
      extended by jodd.util.collection.StringKeyedMapAdapter
          extended by jodd.servlet.HttpServletContextMap
All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.Object>

public class HttpServletContextMap
extends StringKeyedMapAdapter

Map backed by the Servlet context for accessing application scoped attributes.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
HttpServletContextMap(javax.servlet.http.HttpServletRequest request)
           
HttpServletContextMap(javax.servlet.ServletContext context)
          Create a map wrapping given servlet context.
 
Method Summary
protected  java.lang.Object getAttribute(java.lang.String key)
          Hooks method that needs to be implemented by concrete subclasses.
protected  java.util.Iterator<java.lang.String> getAttributeNames()
          Hook method that needs to be implemented by concrete subclasses.
protected  void removeAttribute(java.lang.String key)
          Hooks method that needs to be implemented by concrete subclasses.
protected  void setAttribute(java.lang.String key, java.lang.Object value)
          Hooks method that needs to be implemented by concrete subclasses.
 
Methods inherited from class jodd.util.collection.StringKeyedMapAdapter
clear, entrySet, get, put, remove
 
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
 

Constructor Detail

HttpServletContextMap

public HttpServletContextMap(javax.servlet.ServletContext context)
Create a map wrapping given servlet context.


HttpServletContextMap

public HttpServletContextMap(javax.servlet.http.HttpServletRequest request)
Method Detail

getAttribute

protected java.lang.Object getAttribute(java.lang.String key)
Description copied from class: StringKeyedMapAdapter
Hooks method that needs to be implemented by concrete subclasses. Gets a value associated with a key.

Specified by:
getAttribute in class StringKeyedMapAdapter

setAttribute

protected void setAttribute(java.lang.String key,
                            java.lang.Object value)
Description copied from class: StringKeyedMapAdapter
Hooks method that needs to be implemented by concrete subclasses. Puts a key-value pair in the map, overwriting any possible earlier value associated with the same key.

Specified by:
setAttribute in class StringKeyedMapAdapter

removeAttribute

protected void removeAttribute(java.lang.String key)
Description copied from class: StringKeyedMapAdapter
Hooks method that needs to be implemented by concrete subclasses. Removes a key and its associated value from the map.

Specified by:
removeAttribute in class StringKeyedMapAdapter

getAttributeNames

protected java.util.Iterator<java.lang.String> getAttributeNames()
Description copied from class: StringKeyedMapAdapter
Hook method that needs to be implemented by concrete subclasses. Returns an enumeration listing all keys known to the map.

Specified by:
getAttributeNames in class StringKeyedMapAdapter


Copyright © 2003-2012 Jodd Team