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)
Binds the given namespace as default namespace.
|
void |
bindNamespaceUri(String prefix,
String namespaceUri)
Binds the given prefix to the given namespace.
|
void |
clear()
Removes all declared prefixes.
|
Iterator<String> |
getBoundPrefixes()
Returns all declared prefixes.
|
String |
getNamespaceURI(String prefix) |
String |
getPrefix(String namespaceUri) |
Iterator |
getPrefixes(String namespaceUri) |
void |
removeBinding(String prefix)
Removes the given prefix from this context.
|
void |
setBindings(Map<String,String> bindings)
Sets the bindings for this namespace context.
|
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
public void setBindings(Map<String,String> bindings)
bindings
- the bindingspublic void bindDefaultNamespaceUri(String namespaceUri)
namespaceUri
- the namespace uripublic void bindNamespaceUri(String prefix, String namespaceUri)
prefix
- the namespace prefixnamespaceUri
- the namespace uripublic void clear()
public Iterator<String> getBoundPrefixes()
public void removeBinding(String prefix)
prefix
- the prefix to be removed