Package net.shibboleth.metadata.dom
Class SimpleNamespaceContext
java.lang.Object
net.shibboleth.metadata.dom.SimpleNamespaceContext
- All Implemented Interfaces:
NamespaceContext
Simple implementation of
NamespaceContext based on a map from prefix values to corresponding URIs. This
implementation only supports a single mapping for a given prefix, that is getPrefixes(String) will always
contain at most 1 element.- Since:
- 0.10.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ImmutableBiMap<String,String> Mappings between namespace prefixes and namespace URIs. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.SimpleNamespaceContext(Map<String, String> prefixToUriMappings) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate ImmutableBiMap.Builder<String,String> Build the initial set of mappings which contains entries for XML and XMLNS.getNamespaceURI(String prefix) getPrefixes(String namespaceURI)
-
Field Details
-
mappings
Mappings between namespace prefixes and namespace URIs.
-
-
Constructor Details
-
SimpleNamespaceContext
public SimpleNamespaceContext()Constructor. -
SimpleNamespaceContext
Constructor.- Parameters:
prefixToUriMappings- Maps prefix values to the corresponding namespace URIs.
-
-
Method Details
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceNamespaceContext
-
getPrefix
- Specified by:
getPrefixin interfaceNamespaceContext
-
getPrefixes
- Specified by:
getPrefixesin interfaceNamespaceContext
-
getMappingsBuilder
Build the initial set of mappings which contains entries for XML and XMLNS.- Returns:
- initial set of mappings
-