public class SimpleNamespaceContext extends Object implements NamespaceContext
javax.xml.namespace.NamespaceContext
implementation.
Follows the standard NamespaceContext
contract, and is loadable
via a java.util.Map
or java.util.Properties
objectConstructor and Description |
---|
SimpleNamespaceContext() |
Modifier and Type | Method and Description |
---|---|
void |
bindDefaultNamespaceUri(String namespaceUri)
Bind the given namespace as default namespace.
|
void |
bindNamespaceUri(String prefix,
String namespaceUri)
Bind the given prefix to the given namespace.
|
void |
clear()
Remove all declared prefixes.
|
Iterator<String> |
getBoundPrefixes()
Return all declared prefixes.
|
String |
getNamespaceURI(String prefix) |
String |
getPrefix(String namespaceUri) |
Iterator<String> |
getPrefixes(String namespaceUri) |
void |
removeBinding(String prefix)
Remove the given prefix from this context.
|
void |
setBindings(Map<String,String> bindings)
Set the bindings for this namespace context.
|
public String getNamespaceURI(String prefix)
getNamespaceURI
in interface NamespaceContext
@Nullable public String getPrefix(String namespaceUri)
getPrefix
in interface NamespaceContext
public Iterator<String> getPrefixes(String namespaceUri)
getPrefixes
in interface NamespaceContext
public void setBindings(Map<String,String> bindings)
public void bindDefaultNamespaceUri(String namespaceUri)
namespaceUri
- the namespace uripublic void bindNamespaceUri(String prefix, String namespaceUri)
prefix
- the namespace prefixnamespaceUri
- the namespace uripublic void removeBinding(@Nullable String prefix)
prefix
- the prefix to be removedpublic void clear()