- java.lang.Object
-
- org.xbib.content.xml.stream.SimpleNamespaceContext
-
- All Implemented Interfaces:
javax.xml.namespace.NamespaceContext
public class SimpleNamespaceContext extends java.lang.Object implements javax.xml.namespace.NamespaceContextSimplejavax.xml.namespace.NamespaceContextimplementation. Follows the standardNamespaceContextcontract, and is loadable via ajava.util.Maporjava.util.Propertiesobject
-
-
Constructor Summary
Constructors Constructor Description SimpleNamespaceContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbindDefaultNamespaceUri(java.lang.String namespaceUri)Binds the given namespace as default namespace.voidbindNamespaceUri(java.lang.String prefix, java.lang.String namespaceUri)Binds the given prefix to the given namespace.voidclear()Removes all declared prefixes.java.util.Iterator<java.lang.String>getBoundPrefixes()Returns all declared prefixes.java.lang.StringgetNamespaceURI(java.lang.String prefix)java.lang.StringgetPrefix(java.lang.String namespaceUri)java.util.Iterator<java.lang.String>getPrefixes(java.lang.String namespaceUri)voidremoveBinding(java.lang.String prefix)Removes the given prefix from this context.voidsetBindings(java.util.Map<java.lang.String,java.lang.String> bindings)Sets the bindings for this namespace context.
-
-
-
Method Detail
-
getNamespaceURI
public java.lang.String getNamespaceURI(java.lang.String prefix)
- Specified by:
getNamespaceURIin interfacejavax.xml.namespace.NamespaceContext
-
getPrefix
public java.lang.String getPrefix(java.lang.String namespaceUri)
- Specified by:
getPrefixin interfacejavax.xml.namespace.NamespaceContext
-
getPrefixes
public java.util.Iterator<java.lang.String> getPrefixes(java.lang.String namespaceUri)
- Specified by:
getPrefixesin interfacejavax.xml.namespace.NamespaceContext
-
setBindings
public void setBindings(java.util.Map<java.lang.String,java.lang.String> bindings)
Sets the bindings for this namespace context. The supplied map must consist of string key value pairs.- Parameters:
bindings- the bindings
-
bindDefaultNamespaceUri
public void bindDefaultNamespaceUri(java.lang.String namespaceUri)
Binds the given namespace as default namespace.- Parameters:
namespaceUri- the namespace uri
-
bindNamespaceUri
public void bindNamespaceUri(java.lang.String prefix, java.lang.String namespaceUri)Binds the given prefix to the given namespace.- Parameters:
prefix- the namespace prefixnamespaceUri- the namespace uri
-
clear
public void clear()
Removes all declared prefixes.
-
getBoundPrefixes
public java.util.Iterator<java.lang.String> getBoundPrefixes()
Returns all declared prefixes.- Returns:
- the declared prefixes
-
removeBinding
public void removeBinding(java.lang.String prefix)
Removes the given prefix from this context.- Parameters:
prefix- the prefix to be removed
-
-