Package org.springframework.util.xml
Class SimpleNamespaceContext
java.lang.Object
org.springframework.util.xml.SimpleNamespaceContext
- All Implemented Interfaces:
NamespaceContext
Simple
javax.xml.namespace.NamespaceContext implementation.
Follows the standard NamespaceContext contract, and is loadable
via a java.util.Map or java.util.Properties object- Since:
- 3.0
- Author:
- Arjen Poutsma, Juergen Hoeller
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbindDefaultNamespaceUri(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.Return all declared prefixes.getNamespaceURI(String prefix) 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 Details
-
SimpleNamespaceContext
public SimpleNamespaceContext()
-
-
Method Details
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceNamespaceContext
-
getPrefix
- Specified by:
getPrefixin interfaceNamespaceContext
-
getPrefixes
- Specified by:
getPrefixesin interfaceNamespaceContext
-
setBindings
Set the bindings for this namespace context. The supplied map must consist of string key value pairs. -
bindDefaultNamespaceUri
Bind the given namespace as default namespace.- Parameters:
namespaceUri- the namespace uri
-
bindNamespaceUri
Bind the given prefix to the given namespace.- Parameters:
prefix- the namespace prefixnamespaceUri- the namespace URI
-
removeBinding
Remove the given prefix from this context.- Parameters:
prefix- the prefix to be removed
-
clear
public void clear()Remove all declared prefixes. -
getBoundPrefixes
Return all declared prefixes.
-