net.sf.kernow.xquery
Class NamespaceBindings

java.lang.Object
  extended by net.sf.kernow.xquery.NamespaceBindings

public class NamespaceBindings
extends java.lang.Object

Record namespace bindings, that is prefix/URI pairs. Neither of prefixes or URIs can be null.


Constructor Summary
NamespaceBindings()
           
 
Method Summary
 void addBinding(java.lang.String prefix, java.lang.String uri)
          Add a binding.
 java.lang.String getBinding(java.lang.String prefix)
          Get the URI bound to the prefix.
 java.util.Set<java.lang.String> getPrefixes()
          Get the set of bound prefixes.
 void removeAllBindings()
          Removes all mappings
 void removeBinding(java.lang.String prefix)
          Removes a prefix from the map
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamespaceBindings

public NamespaceBindings()
Method Detail

addBinding

public void addBinding(java.lang.String prefix,
                       java.lang.String uri)
                throws java.lang.NullPointerException,
                       java.lang.IllegalArgumentException
Add a binding. This is an error if the prefix is already bound.

Throws:
java.lang.NullPointerException - If either the prefix or the URI is null.
java.lang.IllegalArgumentException - If either the prefix is already bound.

removeBinding

public void removeBinding(java.lang.String prefix)
                   throws java.lang.NullPointerException
Removes a prefix from the map

Parameters:
prefix - The prefix of the binding that should be removed
Throws:
java.lang.NullPointerException

removeAllBindings

public void removeAllBindings()
Removes all mappings


getBinding

public java.lang.String getBinding(java.lang.String prefix)
                            throws java.lang.NullPointerException
Get the URI bound to the prefix.

Returns:
The URI bound to the prefix or null if the prefix is not bound.
Throws:
java.lang.NullPointerException - If the prefix is null.

getPrefixes

public java.util.Set<java.lang.String> getPrefixes()
Get the set of bound prefixes.

Returns:
The namespace bindings.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object