org.apache.camel.builder.xml
Class DefaultNamespaceContext

java.lang.Object
  extended by org.apache.camel.builder.xml.DefaultNamespaceContext
All Implemented Interfaces:
NamespaceContext, NamespaceAware

public class DefaultNamespaceContext
extends Object
implements NamespaceContext, NamespaceAware

An implementation of NamespaceContext which uses a simple Map where the keys are the prefixes and the values are the URIs


Constructor Summary
DefaultNamespaceContext()
           
DefaultNamespaceContext(NamespaceContext parent, Map<String,String> map)
           
DefaultNamespaceContext(XPathFactory factory)
           
 
Method Summary
 DefaultNamespaceContext add(String prefix, String uri)
          A helper method to make it easy to create newly populated instances
 String getNamespaceURI(String prefix)
           
 String getPrefix(String namespaceURI)
           
 Iterator<String> getPrefixes(String namespaceURI)
           
 void setNamespaces(Map<String,String> namespaces)
          Injects the XML Namespaces of prefix -> uri mappings
 String toString()
          toString() implementation that outputs the namespace mappings with the following format: "[me: {prefix -> value}, {prefix -> value}], [parent: {prefix -> value}, {prefix -> value}].
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultNamespaceContext

public DefaultNamespaceContext()

DefaultNamespaceContext

public DefaultNamespaceContext(XPathFactory factory)

DefaultNamespaceContext

public DefaultNamespaceContext(NamespaceContext parent,
                               Map<String,String> map)
Method Detail

add

public DefaultNamespaceContext add(String prefix,
                                   String uri)
A helper method to make it easy to create newly populated instances


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

setNamespaces

public void setNamespaces(Map<String,String> namespaces)
Description copied from interface: NamespaceAware
Injects the XML Namespaces of prefix -> uri mappings

Specified by:
setNamespaces in interface NamespaceAware
Parameters:
namespaces - the XML namespaces with the key of prefixes and the value the URIs

toString

public String toString()
toString() implementation that outputs the namespace mappings with the following format: "[me: {prefix -> value}, {prefix -> value}], [parent: {prefix -> value}, {prefix -> value}]. Recurses up the parent's chain.

Overrides:
toString in class Object


Apache CAMEL