Package org.apache.camel.language.xpath
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 ofNamespaceContext
which uses a simple Map where the keys are the prefixes and the values are the URIs
-
-
Constructor Summary
Constructors Constructor Description DefaultNamespaceContext()
DefaultNamespaceContext(NamespaceContext parent, Map<String,String> map)
DefaultNamespaceContext(XPathFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultNamespaceContext
add(String prefix, String uri)
A helper method to make it easy to create newly populated instancesMap<String,String>
getNamespaces()
String
getNamespaceURI(String prefix)
String
getPrefix(String namespaceURI)
Iterator<String>
getPrefixes(String namespaceURI)
void
setNamespaces(Map<String,String> namespaces)
String
toString()
toString() implementation that outputs the namespace mappings with the following format: "[me: {prefix -> value}, {prefix -> value}], [parent: {prefix -> value}, {prefix -> value}].
-
-
-
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 interfaceNamespaceContext
-
getPrefix
public String getPrefix(String namespaceURI)
- Specified by:
getPrefix
in interfaceNamespaceContext
-
getPrefixes
public Iterator<String> getPrefixes(String namespaceURI)
- Specified by:
getPrefixes
in interfaceNamespaceContext
-
setNamespaces
public void setNamespaces(Map<String,String> namespaces)
- Specified by:
setNamespaces
in interfaceorg.apache.camel.spi.NamespaceAware
-
getNamespaces
public Map<String,String> getNamespaces()
- Specified by:
getNamespaces
in interfaceorg.apache.camel.spi.NamespaceAware
-
-