public class SimpleNamespaceContext extends java.lang.Object implements NamespaceContext
| Modifier and Type | Field and Description |
|---|---|
static SimpleNamespaceContext |
EMPTY_CONTEXT
An empty context containing no prefixes at all.
|
private java.util.Map<java.lang.String,java.lang.String> |
prefixMap |
| Constructor and Description |
|---|
SimpleNamespaceContext(java.util.Map prefixMap)
Creates a NamespaceContext backed by the given map.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getNamespaceURI(java.lang.String prefix)
Obtain the URI for a given prefix.
|
java.util.Iterator<java.lang.String> |
getPrefixes()
Get all prefixes of this context.
|
private final java.util.Map<java.lang.String,java.lang.String> prefixMap
public static final SimpleNamespaceContext EMPTY_CONTEXT
public SimpleNamespaceContext(java.util.Map prefixMap)
Copies the map, changes made to the given map after calling the constructor are not reflected into the NamespaceContext.
prefixMap - maps prefix to Namespace URIpublic java.lang.String getNamespaceURI(java.lang.String prefix)
NamespaceContextUnlike the method in javax.xml.namespace.NamespaceContext doesn't have to implement any special handling for predefined prefix values.
getNamespaceURI in interface NamespaceContextpublic java.util.Iterator<java.lang.String> getPrefixes()
NamespaceContextgetPrefixes in interface NamespaceContext