Class DefaultNamespaceContext

java.lang.Object
org.apache.camel.language.xpath.DefaultNamespaceContext
All Implemented Interfaces:
NamespaceContext, org.apache.camel.spi.NamespaceAware

public class DefaultNamespaceContext extends Object implements NamespaceContext, org.apache.camel.spi.NamespaceAware
An implementation of NamespaceContext which uses a simple Map where the keys are the prefixes and the values are the URIs
  • Constructor Details

    • DefaultNamespaceContext

      public DefaultNamespaceContext()
    • DefaultNamespaceContext

      public DefaultNamespaceContext(XPathFactory factory)
    • DefaultNamespaceContext

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

    • 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)
      Specified by:
      setNamespaces in interface org.apache.camel.spi.NamespaceAware
    • getNamespaces

      public Map<String,String> getNamespaces()
      Specified by:
      getNamespaces in interface org.apache.camel.spi.NamespaceAware
    • 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