public class NamespaceContextImpl extends Object implements NamespaceContext
Modifier and Type | Field and Description |
---|---|
protected Element |
element |
protected Map<String,Set<String>> |
nsUriToPrefixesMap |
protected Map<String,String> |
prefixToNsUriMap |
Constructor and Description |
---|
NamespaceContextImpl()
Create an empty namespace context.
|
NamespaceContextImpl(Element element)
Create a namespace context that will lookup namespace
information in the given element.
|
Modifier and Type | Method and Description |
---|---|
void |
addNamespace(String prefix,
String namespaceURI)
Add a custom mapping from prefix to a namespace.
|
String |
getNamespaceURI(String prefix) |
String |
getPrefix(String namespaceURI) |
Iterator |
getPrefixes(String namespaceURI) |
protected Element element
public NamespaceContextImpl()
public NamespaceContextImpl(Element element)
public void addNamespace(String prefix, String namespaceURI)
prefix
- the namespace's prefix. Use an empty string for the
default prefix.namespaceURI
- the namespace URI to map.public String getNamespaceURI(String prefix)
getNamespaceURI
in interface NamespaceContext
public String getPrefix(String namespaceURI)
getPrefix
in interface NamespaceContext
public Iterator getPrefixes(String namespaceURI)
getPrefixes
in interface NamespaceContext
Copyright © 2013. All Rights Reserved.