Package org.springframework.util.xml
Class SimpleNamespaceContext
- java.lang.Object
- org.springframework.util.xml.SimpleNamespaceContext
- All Implemented Interfaces:
NamespaceContext
public class SimpleNamespaceContext extends Object implements NamespaceContext
Simplejavax.xml.namespace.NamespaceContextimplementation. Follows the standardNamespaceContextcontract, and is loadable via ajava.util.Maporjava.util.Propertiesobject- Since:
- 3.0
- Author:
- Arjen Poutsma, Juergen Hoeller
Constructor Summary
Constructors Constructor Description SimpleNamespaceContext()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbindDefaultNamespaceUri(String namespaceUri)Bind the given namespace as default namespace.voidbindNamespaceUri(String prefix, String namespaceUri)Bind the given prefix to the given namespace.voidclear()Remove all declared prefixes.Iterator<String>getBoundPrefixes()Return all declared prefixes.StringgetNamespaceURI(String prefix)StringgetPrefix(String namespaceUri)Iterator<String>getPrefixes(String namespaceUri)voidremoveBinding(String prefix)Remove the given prefix from this context.voidsetBindings(Map<String,String> bindings)Set the bindings for this namespace context.
Constructor Detail
SimpleNamespaceContext
public SimpleNamespaceContext()
Method Detail
getNamespaceURI
public String getNamespaceURI(String prefix)
- Specified by:
getNamespaceURIin interfaceNamespaceContext
getPrefix
public String getPrefix(String namespaceUri)
- Specified by:
getPrefixin interfaceNamespaceContext
getPrefixes
public Iterator<String> getPrefixes(String namespaceUri)
- Specified by:
getPrefixesin interfaceNamespaceContext
setBindings
public void setBindings(Map<String,String> bindings)
Set the bindings for this namespace context. The supplied map must consist of string key value pairs.
bindDefaultNamespaceUri
public void bindDefaultNamespaceUri(String namespaceUri)
Bind the given namespace as default namespace.- Parameters:
namespaceUri- the namespace uri
bindNamespaceUri
public void bindNamespaceUri(String prefix, String namespaceUri)
Bind the given prefix to the given namespace.- Parameters:
prefix- the namespace prefixnamespaceUri- the namespace uri
removeBinding
public void removeBinding(String prefix)
Remove the given prefix from this context.- Parameters:
prefix- the prefix to be removed
clear
public void clear()
Remove all declared prefixes.
getBoundPrefixes
public Iterator<String> getBoundPrefixes()
Return all declared prefixes.