Class SimpleNamespaceContext
java.lang.Object
org.springframework.xml.namespace.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:
- 1.0.0
- Author:
- Arjen Poutsma
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbindDefaultNamespaceUri(String namespaceUri) Binds the given namespace as default namespace.voidbindNamespaceUri(String prefix, String namespaceUri) Binds the given prefix to the given namespace.voidclear()Removes all declared prefixes.Returns all declared prefixes.getNamespaceURI(String prefix) getPrefixes(String namespaceUri) booleanhasBinding(String prefix) voidremoveBinding(String prefix) Removes the given prefix from this context.voidsetBindings(Map<String, String> bindings) Sets 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
Sets the bindings for this namespace context. The supplied map must consist of string key value pairs.- Parameters:
bindings- the bindings
-
bindDefaultNamespaceUri
Binds the given namespace as default namespace.- Parameters:
namespaceUri- the namespace uri
-
bindNamespaceUri
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
Returns all declared prefixes.- Returns:
- the declared prefixes
-
removeBinding
Removes the given prefix from this context.- Parameters:
prefix- the prefix to be removed
-
hasBinding
-