|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.apache.lenya.util.NamespaceMap
public class NamespaceMap
An object of this class provides an easy way to access Strings in a Map that are prefixed like "prefix.foo". The actual map wrapped by this object can contain more key-value-pairs, but you can access only the prefixed keys through the mapper.
| Field Summary | |
|---|---|
static java.lang.String |
SEPARATOR
SEPARATOR The seperator character |
| Constructor Summary | |
|---|---|
NamespaceMap(java.util.Map _map,
java.lang.String _prefix)
Creates a new NamespaceMap. |
|
NamespaceMap(java.lang.String _prefix)
Creates a new NamespaceMap object. |
|
| Method Summary | |
|---|---|
java.lang.Object |
get(java.lang.String key)
Returns the value for a prefixed key. |
static java.lang.String |
getFullName(java.lang.String prefix,
java.lang.String key)
Returns the full (prefixed) key for a short (un-prefixed) key. |
java.util.Map |
getMap()
Returns a map that contains only the un-prefixed key-value-pairs. |
protected java.util.Map |
getMapObject()
Returns the namespace prefix. |
java.lang.String |
getPrefix()
Returns the prefix. |
java.util.Map |
getPrefixedMap()
Returns a map with prefixed keys. |
static java.lang.String |
getShortName(java.lang.String prefix,
java.lang.String key)
Returns the short (un-prefixed) key for a full (prefixed) key. |
void |
put(java.lang.String key,
java.lang.Object value)
Puts a value for prefixed key into the map. |
void |
putAll(java.util.Map _map)
Puts all prefixed key-value-pairs of map into this map. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SEPARATOR
SEPARATOR The seperator character
| Constructor Detail |
|---|
public NamespaceMap(java.lang.String _prefix)
_prefix - The prefix.
public NamespaceMap(java.util.Map _map,
java.lang.String _prefix)
_map - A map containing the prefixed key-value-pairs._prefix - The prefix.| Method Detail |
|---|
public java.lang.String getPrefix()
protected java.util.Map getMapObject()
public java.util.Map getMap()
public void put(java.lang.String key,
java.lang.Object value)
key - The key without prefix.value - The value.public java.lang.Object get(java.lang.String key)
key - The key without prefix.
public static java.lang.String getFullName(java.lang.String prefix,
java.lang.String key)
prefix - The prefix.key - The un-prefixed key.
SEPARATOR + key).
public static java.lang.String getShortName(java.lang.String prefix,
java.lang.String key)
prefix - The prefix.key - The full (prefixed) key.
public void putAll(java.util.Map _map)
_map - A map.public java.util.Map getPrefixedMap()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||