ParameterMappublic final class ParameterMap extends HashMap Extended implementation of HashMap that includes a
locked property. This class can be used to safely expose
Catalina internal parameter map objects to user classes without having
to clone them in order to avoid modifications. When first created, a
ParmaeterMap instance is not locked. |
Fields Summary |
---|
private boolean | lockedThe current lock state of this parameter map. | private static final StringManager | smThe string manager for this package. |
Constructors Summary |
---|
public ParameterMap()Construct a new, empty map with the default initial capacity and
load factor.
super();
| public ParameterMap(int initialCapacity)Construct a new, empty map with the specified initial capacity and
default load factor.
super(initialCapacity);
| public ParameterMap(int initialCapacity, float loadFactor)Construct a new, empty map with the specified initial capacity and
load factor.
super(initialCapacity, loadFactor);
| public ParameterMap(Map map)Construct a new map with the same mappings as the given map.
super(map);
|
Methods Summary |
---|
public void | clear()Remove all mappings from this map.
// --------------------------------------------------------- Public Methods
if (locked)
throw new IllegalStateException
(sm.getString("parameterMap.locked"));
super.clear();
| public boolean | isLocked()Return the locked state of this parameter map.
return (this.locked);
| public java.lang.Object | put(java.lang.Object key, java.lang.Object value)Associate the specified value with the specified key in this map. If
the map previously contained a mapping for this key, the old value is
replaced.
if (locked)
throw new IllegalStateException
(sm.getString("parameterMap.locked"));
return (super.put(key, value));
| public void | putAll(java.util.Map map)Copy all of the mappings from the specified map to this one. These
mappings replace any mappings that this map had for any of the keys
currently in the specified Map.
if (locked)
throw new IllegalStateException
(sm.getString("parameterMap.locked"));
super.putAll(map);
| public java.lang.Object | remove(java.lang.Object key)Remove the mapping for this key from the map if present.
if (locked)
throw new IllegalStateException
(sm.getString("parameterMap.locked"));
return (super.remove(key));
| public void | setLocked(boolean locked)Set the locked state of this parameter map.
this.locked = locked;
|
|