org.pf.pax
Class NamespacePrefixMapper

java.lang.Object
  extended by org.pf.pax.NamespacePrefixMapper
All Implemented Interfaces:
javax.xml.namespace.NamespaceContext

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

An implementation that handles namespace prefix to URI and URI to prefix mapping.

Version:
1.0
Author:
M.Duchrow

Constructor Summary
NamespacePrefixMapper()
          Initialize the new instance with an empty mapping.
NamespacePrefixMapper(java.util.Map<java.lang.String,java.lang.String> prefixToURIMappings)
          Initialize the new instance with the given mappings.
 
Method Summary
 void addMapping(java.lang.String nsPrefix, java.lang.String nsURI)
          Add the prefix and URI to the mappings.
 java.lang.String getNamespaceURI(java.lang.String prefix)
           
 java.lang.String getPrefix(java.lang.String namespaceURI)
           
 java.util.Iterator getPrefixes(java.lang.String namespaceURI)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespacePrefixMapper

public NamespacePrefixMapper(java.util.Map<java.lang.String,java.lang.String> prefixToURIMappings)
Initialize the new instance with the given mappings.


NamespacePrefixMapper

public NamespacePrefixMapper()
Initialize the new instance with an empty mapping.

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 getPrefixes(java.lang.String namespaceURI)
Specified by:
getPrefixes in interface javax.xml.namespace.NamespaceContext

addMapping

public void addMapping(java.lang.String nsPrefix,
                       java.lang.String nsURI)
Add the prefix and URI to the mappings.