public class ApplicationMap extends AbstractMap implements Serializable
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.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
ApplicationMap(javax.servlet.ServletContext ctx)
Creates a new map object given the servlet context.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, valuespublic ApplicationMap(javax.servlet.ServletContext ctx)
ctx - the servlet contextpublic void clear()
clear in interface Mapclear in class AbstractMappublic Set entrySet()
entrySet in interface MapentrySet in class AbstractMappublic Object get(Object key)
get in interface Mapget in class AbstractMapkey - the entry key.public Object put(Object key, Object value)
put in interface Mapput in class AbstractMapkey - the name of the attribute.value - the value to set.Copyright © 2000–2016 Apache Software Foundation. All rights reserved.