Class NamespaceBindings

java.lang.Object
org.opengis.cite.gpkg12.util.NamespaceBindings
All Implemented Interfaces:
NamespaceContext

public class NamespaceBindings extends Object implements NamespaceContext
Provides namespace bindings for evaluating XPath 1.0 expressions using the JAXP XPath API. A namespace name (URI) may be bound to only one prefix.
  • Constructor Details

    • NamespaceBindings

      public NamespaceBindings()
  • Method Details

    • getNamespaceURI

      public String getNamespaceURI(String prefix)
      Specified by:
      getNamespaceURI in interface NamespaceContext
    • getPrefix

      public String getPrefix(String namespaceURI)
      Specified by:
      getPrefix in interface NamespaceContext
    • getPrefixes

      public Iterator<String> getPrefixes(String namespaceURI)
      Specified by:
      getPrefixes in interface NamespaceContext
    • addNamespaceBinding

      public void addNamespaceBinding(String namespaceURI, String prefix)
      Adds a namespace binding that associates a namespace name with a prefix. If a binding for a given namespace name already exists it will be replaced.
      Parameters:
      namespaceURI - A String denoting a namespace name (an absolute URI value).
      prefix - A prefix associated with the namespace name.
    • addAllBindings

      public void addAllBindings(Map<String,String> nsBindings)
      Adds all of the supplied namespace bindings to the existing set of entries.
      Parameters:
      nsBindings - A Map containing a collection of namespace bindings where the key is an absolute URI specifying the namespace name and the value denotes the associated prefix.
    • getAllBindings

      public Map<String,String> getAllBindings()
      Returns an unmodifiable view of the declared namespace bindings.
      Returns:
      An immutable Map containing zero or more namespace bindings where the key is an absolute URI specifying the namespace name and the value is the associated prefix.
    • withStandardBindings

      public static NamespaceBindings withStandardBindings()
      Creates a NamespaceBindings object that declares the following namespace bindings:
      Returns:
      A NamespaceBindings object.
    • toString

      public String toString()
      Overrides:
      toString in class Object