|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
org.apache.struts2.dispatcher.ApplicationMap
public class ApplicationMap
A simple implementation of the Map
interface to handle a collection of attributes and
init parameters in a ServletContext
object. The entrySet()
method
enumerates over all servlet context attributes and init parameters and returns a collection of both.
Note, this will occur lazily - only when the entry set is asked for.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary | |
---|---|
private ServletContext |
context
|
private Set<Object> |
entries
|
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
ApplicationMap(ServletContext ctx)
Creates a new map object given the servlet context. |
Method Summary | |
---|---|
void |
clear()
Removes all entries from the Map and removes all attributes from the servlet context. |
Set |
entrySet()
Creates a Set of all servlet context attributes as well as context init parameters. |
Object |
get(Object key)
Returns the servlet context attribute or init parameter based on the given key. |
Object |
put(Object key,
Object value)
Sets a servlet context attribute given a attribute name and value. |
Object |
remove(Object key)
Removes the specified servlet context 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 |
---|
private static final long serialVersionUID
private ServletContext context
private Set<Object> entries
Constructor Detail |
---|
public ApplicationMap(ServletContext ctx)
ctx
- the servlet contextMethod Detail |
---|
public void clear()
clear
in interface Map
clear
in class AbstractMap
public Set entrySet()
entrySet
in interface Map
entrySet
in class AbstractMap
public Object get(Object key)
get
in interface Map
get
in class AbstractMap
key
- the entry key.
public Object put(Object key, Object value)
put
in interface Map
put
in class AbstractMap
key
- the name of the attribute.value
- the value to set.
public Object remove(Object key)
remove
in interface Map
remove
in class AbstractMap
key
- the attribute to remove.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |