|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.exist.fluent.NamespaceMap
public class NamespaceMap
A map of short keys to namespace uris that can be cascaded. Use the empty string as the key for the default namespace.
Constructor Summary | |
---|---|
NamespaceMap(String... args)
Create a new namespace map with no inherited bindings. |
Method Summary | |
---|---|
void |
clear()
Clear all bindings from this map. |
NamespaceMap |
clone()
Return a clone of this map. |
boolean |
equals(Object o)
|
NamespaceMap |
extend()
Create a namespace map inheriting from this one. |
String |
get(String key)
Get the URI bound to the given key, either in this map or the closest inherited one. |
Map<String,String> |
getCombinedMap()
Return a realized map of keys to URIs that combines all information inherited from parents. |
int |
hashCode()
|
boolean |
isFreshFrom(NamespaceMap freshParent)
Return whether this namespace map contains no bindings other than inherited ones, and inherits from the given parent. |
static boolean |
isReservedPrefix(String prefix)
Return whether the given prefix is reserved by the XML spec and should not be manually bound to namespaces. |
void |
put(String key,
String uri)
Bind the given key to the given URI in this map. |
void |
putAll(NamespaceMap that)
Put all bindings from the given map into this one. |
void |
remove(String key)
Remove any binding for the given key from the map. |
void |
replaceWith(NamespaceMap that)
Sever inheritance connections and replace all bindings with ones from the given map. |
void |
sever()
Sever this namespace map from its parents. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NamespaceMap(String... args)
args
- a list interleaving keys and their associated URIs; its length must be evenMethod Detail |
---|
public static boolean isReservedPrefix(String prefix)
prefix
- the prefix to check
true
if the prefix is reserved, false
if it's available for bindingpublic NamespaceMap extend()
public NamespaceMap clone()
clone
in class Object
public void sever()
clear()
on a severed map is guaranteed to clear all bindings.
public String get(String key)
null
.
key
- the key to look up
null
if nonepublic void put(String key, String uri)
key
- the key to useuri
- the namespace URI to bindpublic void remove(String key)
key
- the key to removepublic void clear()
public void putAll(NamespaceMap that)
that
- the map to copy bindings frompublic void replaceWith(NamespaceMap that)
sever()
, clear()
and putAll(NamespaceMap)
in sequence.
that
- the map to copy bindings frompublic Map<String,String> getCombinedMap()
public boolean isFreshFrom(NamespaceMap freshParent)
freshParent
- the fresh parent to compare against
true
if this namespace map is empty except for possible
inherited bindings, false
otherwisepublic boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |