Class NamespaceContextMap
- java.lang.Object
-
- org.gcube.spatial.data.geoutility.util.NamespaceContextMap
-
- All Implemented Interfaces:
NamespaceContext
public final class NamespaceContextMap extends Object implements NamespaceContext
The Class NamespaceContextMap.- Author:
- Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Jan 22, 2016
-
-
Constructor Summary
Constructors Constructor Description NamespaceContextMap(String... mappingPairs)Convenience constructor.NamespaceContextMap(Map<String,String> prefixMappings)Constructor that takes a map of XML prefix-namespaceURI values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>getMap()Gets the map.StringgetNamespaceURI(String prefix)StringgetPrefix(String namespaceURI)Iterator<String>getPrefixes(String namespaceURI)StringtoString()
-
-
-
Constructor Detail
-
NamespaceContextMap
public NamespaceContextMap(Map<String,String> prefixMappings)
Constructor that takes a map of XML prefix-namespaceURI values. A defensive copy is made of the map. An IllegalArgumentException will be thrown if the map attempts to remap the standard prefixes defined in the NamespaceContext contract.- Parameters:
prefixMappings- a map of prefix:namespaceURI values
-
NamespaceContextMap
public NamespaceContextMap(String... mappingPairs)
Convenience constructor.- Parameters:
mappingPairs- pairs of prefix-namespaceURI values
-
-
Method Detail
-
getNamespaceURI
public String getNamespaceURI(String prefix)
- Specified by:
getNamespaceURIin interfaceNamespaceContext
-
getPrefix
public String getPrefix(String namespaceURI)
- Specified by:
getPrefixin interfaceNamespaceContext
-
getPrefixes
public Iterator<String> getPrefixes(String namespaceURI)
- Specified by:
getPrefixesin interfaceNamespaceContext
-
getMap
public Map<String,String> getMap()
Gets the map.- Returns:
- an unmodifiable map of the mappings in the form prefix-namespaceURI
-
-