Package de.aristaflow.adept2.util.xml
Class NamespaceLookup
java.lang.Object
de.aristaflow.adept2.util.xml.NamespaceLookup
- All Implemented Interfaces:
NamespaceContext
A resolver looking up the namespace in a map of provided namespaces and in a specific
Document.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConcurrentMap<String,String> Additional prefixes in a map indexed by the corresponding namespace.protected final ConcurrentMap<String,String> Additional namespaces in a map indexed by the corresponding prefix.protected final DocumentThe document in which to lookup the namespace. -
Constructor Summary
ConstructorsConstructorDescriptionNamespaceLookup(Document document) Creates a newNamespaceContextlooking up namespaces in the designatedDocumentor additionally set namespaces. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNamespace(String prefix, String namespace) Adds the designated prefix and namespace additionally to the document.getNamespaceURI(String prefix) getPrefixes(String namespaceURI)
-
Field Details
-
pref2Ns
Additional namespaces in a map indexed by the corresponding prefix. This takes precedence oversourceDocument. -
ns2Pref
Additional prefixes in a map indexed by the corresponding namespace. This is the reverse mapping ofpref2Ns. It takes precedence oversourceDocument. -
sourceDocument
The document in which to lookup the namespace.
-
-
Constructor Details
-
NamespaceLookup
Creates a newNamespaceContextlooking up namespaces in the designatedDocumentor additionally set namespaces.- Parameters:
document- The document in which to lookup the namespace.
-
-
Method Details
-
addNamespace
Adds the designated prefix and namespace additionally to the document. This takes precedence over the document.- Parameters:
prefix- The prefix which to additionally add.namespace- The namespace which to additionally add.
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceNamespaceContext
-
getPrefix
- Specified by:
getPrefixin interfaceNamespaceContext
-
getPrefixes
- Specified by:
getPrefixesin interfaceNamespaceContext
-