org.opengis.cite.owc.util
Class NamespaceBindings

java.lang.Object
  extended by org.opengis.cite.owc.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 Summary
NamespaceBindings()
           
 
Method Summary
 void addAllBindings(Map<String,String> nsBindings)
          Adds all of the supplied namespace bindings to the existing set of entries.
 void addNamespaceBinding(String namespaceURI, String prefix)
          Adds a namespace binding that associates a namespace name with a prefix.
 Map<String,String> getAllBindings()
          Returns an unmodifiable view of the declared namespace bindings.
 String getNamespaceURI(String prefix)
           
 String getPrefix(String namespaceURI)
           
 Iterator<String> getPrefixes(String namespaceURI)
           
 String toString()
           
static NamespaceBindings withStandardBindings()
          Creates a NamespaceBindings object that declares the following namespace bindings: ows: "http://www.opengis.net/ows/1.1" xlink: "http://www.w3.org/1999/xlink" gml: "http://www.opengis.net/gml/3.2"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamespaceBindings

public NamespaceBindings()
Method Detail

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


Copyright © 2014. All Rights Reserved.