org.fedoracommons.funapi.utilities
Class NamespaceContextImpl

java.lang.Object
  extended by org.fedoracommons.funapi.utilities.NamespaceContextImpl
All Implemented Interfaces:
javax.xml.namespace.NamespaceContext

public class NamespaceContextImpl
extends java.lang.Object
implements javax.xml.namespace.NamespaceContext

An implementation of NamespaceContext that provides an addNamespace method.

Version:
$Id: NamespaceContextImpl.java 33 2008-10-25 19:31:36Z pangloss $
Author:
Edwin Shin

Constructor Summary
NamespaceContextImpl()
           
NamespaceContextImpl(java.util.Map<java.lang.String,java.lang.String> prefix2ns)
          Constructor that takes a Map of prefix to namespaces.
NamespaceContextImpl(java.lang.String prefix, java.lang.String namespaceURI)
           
 
Method Summary
 void addNamespace(java.lang.String prefix, java.lang.String namespaceURI)
          Add a prefix to namespace mapping.
 java.lang.String getNamespaceURI(java.lang.String prefix)
          
 java.lang.String getPrefix(java.lang.String namespaceURI)
          
 java.util.Iterator<java.lang.String> getPrefixes(java.lang.String namespaceURI)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceContextImpl

public NamespaceContextImpl()

NamespaceContextImpl

public NamespaceContextImpl(java.lang.String prefix,
                            java.lang.String namespaceURI)

NamespaceContextImpl

public NamespaceContextImpl(java.util.Map<java.lang.String,java.lang.String> prefix2ns)
Constructor that takes a Map of prefix to namespaces.

Parameters:
prefix2ns - a mapping of prefixes to namespaces.
Throws:
java.lang.IllegalArgumentException - if prefix2ns contains "http://www.w3.org/XML/1998/namespace" or "http://www.w3.org/2000/xmlns/"
Method Detail

getNamespaceURI

public java.lang.String getNamespaceURI(java.lang.String prefix)

Specified by:
getNamespaceURI in interface javax.xml.namespace.NamespaceContext

getPrefix

public java.lang.String getPrefix(java.lang.String namespaceURI)

Specified by:
getPrefix in interface javax.xml.namespace.NamespaceContext

getPrefixes

public java.util.Iterator<java.lang.String> getPrefixes(java.lang.String namespaceURI)

Specified by:
getPrefixes in interface javax.xml.namespace.NamespaceContext

addNamespace

public void addNamespace(java.lang.String prefix,
                         java.lang.String namespaceURI)
Add a prefix to namespace mapping.

Parameters:
prefix -
namespaceURI -
Throws:
java.lang.IllegalArgumentException - if namespaceURI is one of "http://www.w3.org/XML/1998/namespace" or "http://www.w3.org/2000/xmlns/"


Copyright © 2008 Fedora Commons, Inc.. All Rights Reserved.