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, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public ApplicationMap(javax.servlet.ServletContext ctx)
ctx
- the servlet contextpublic 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.Copyright © 2000–2020 Apache Software Foundation. All rights reserved.