Package org.custommonkey.xmlunit
Class SimpleNamespaceContext
java.lang.Object
org.custommonkey.xmlunit.SimpleNamespaceContext
- All Implemented Interfaces:
NamespaceContext
Implementation of NamespaceContext that's backed by a map.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SimpleNamespaceContext
An empty context containing no prefixes at all. -
Constructor Summary
ConstructorDescriptionSimpleNamespaceContext
(Map prefixMap) Creates a NamespaceContext backed by the given map. -
Method Summary
Modifier and TypeMethodDescriptiongetNamespaceURI
(String prefix) Obtain the URI for a given prefix.Get all prefixes of this context.
-
Field Details
-
EMPTY_CONTEXT
An empty context containing no prefixes at all.
-
-
Constructor Details
-
SimpleNamespaceContext
Creates a NamespaceContext backed by the given map.Copies the map, changes made to the given map after calling the constructor are not reflected into the NamespaceContext.
- Parameters:
prefixMap
- maps prefix to Namespace URI
-
-
Method Details
-
getNamespaceURI
Description copied from interface:NamespaceContext
Obtain the URI for a given prefix.Unlike the method in javax.xml.namespace.NamespaceContext doesn't have to implement any special handling for predefined prefix values.
- Specified by:
getNamespaceURI
in interfaceNamespaceContext
- Parameters:
prefix
- prefix to look up- Returns:
- null if the prefix is unknown.
-
getPrefixes
Description copied from interface:NamespaceContext
Get all prefixes of this context.- Specified by:
getPrefixes
in interfaceNamespaceContext
- Returns:
- all prefixes of this context
-