| java.lang.Object org.apache.lenya.util.NamespaceMap
NamespaceMap | public class NamespaceMap (Code) | | 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.
|
Method Summary | |
public Object | get(String key) Returns the value for a prefixed key.
Parameters: key - The key without prefix. | public static String | getFullName(String prefix, String key) Returns the full (prefixed) key for a short (un-prefixed) key.
Parameters: prefix - The prefix. Parameters: key - The un-prefixed key. | public Map | getMap() Returns a map that contains only the un-prefixed key-value-pairs. | protected Map | getMapObject() Returns the namespace prefix. | public String | getPrefix() Returns the prefix. | public Map | getPrefixedMap() Returns a map with prefixed keys. | public static String | getShortName(String prefix, String key) Returns the short (un-prefixed) key for a full (prefixed) key.
Parameters: prefix - The prefix. Parameters: key - The full (prefixed) key. | public void | put(String key, Object value) Puts a value for prefixed key into the map. | public void | putAll(Map _map) Puts all prefixed key-value-pairs of map into this map. |
SEPARATOR | final public static String SEPARATOR(Code) | | SEPARATOR The seperator character
|
NamespaceMap | public NamespaceMap(String _prefix)(Code) | | Creates a new NamespaceMap object.
Parameters: _prefix - The prefix. |
NamespaceMap | public NamespaceMap(Map _map, String _prefix)(Code) | | Creates a new NamespaceMap.
Parameters: _map - A map containing the prefixed key-value-pairs. Parameters: _prefix - The prefix. |
get | public Object get(String key)(Code) | | Returns the value for a prefixed key.
Parameters: key - The key without prefix. The value. |
getFullName | public static String getFullName(String prefix, String key)(Code) | | Returns the full (prefixed) key for a short (un-prefixed) key.
Parameters: prefix - The prefix. Parameters: key - The un-prefixed key. A string (prefix + NamespaceMap.SEPARATOR + key). |
getMap | public Map getMap()(Code) | | Returns a map that contains only the un-prefixed key-value-pairs.
The map. |
getMapObject | protected Map getMapObject()(Code) | | Returns the namespace prefix.
The namespace prefix. |
getPrefix | public String getPrefix()(Code) | | Returns the prefix.
A string. |
getPrefixedMap | public Map getPrefixedMap()(Code) | | Returns a map with prefixed keys.
A map. |
getShortName | public static String getShortName(String prefix, String key)(Code) | | Returns the short (un-prefixed) key for a full (prefixed) key.
Parameters: prefix - The prefix. Parameters: key - The full (prefixed) key. A string. |
put | public void put(String key, Object value)(Code) | | Puts a value for prefixed key into the map.
Parameters: key - The key without prefix. Parameters: value - The value. |
putAll | public void putAll(Map _map)(Code) | | Puts all prefixed key-value-pairs of map into this map.
Parameters: _map - A map. |
|
|