public class DefaultNamespaceContext extends Object implements NamespaceContext, NamespaceAware
NamespaceContext
which uses a simple Map where
the keys are the prefixes and the values are the URIsConstructor and Description |
---|
DefaultNamespaceContext() |
DefaultNamespaceContext(NamespaceContext parent,
Map<String,String> map) |
DefaultNamespaceContext(XPathFactory factory) |
Modifier and Type | Method and Description |
---|---|
DefaultNamespaceContext |
add(String prefix,
String uri)
A helper method to make it easy to create newly populated instances
|
Map<String,String> |
getNamespaces()
Gets the XML Namespaces
|
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}].
|
public DefaultNamespaceContext()
public DefaultNamespaceContext(XPathFactory factory)
public DefaultNamespaceContext(NamespaceContext parent, Map<String,String> map)
public DefaultNamespaceContext add(String prefix, String uri)
public String getNamespaceURI(String prefix)
getNamespaceURI
in interface NamespaceContext
public String getPrefix(String namespaceURI)
getPrefix
in interface NamespaceContext
public Iterator<String> getPrefixes(String namespaceURI)
getPrefixes
in interface NamespaceContext
public void setNamespaces(Map<String,String> namespaces)
NamespaceAware
setNamespaces
in interface NamespaceAware
namespaces
- the XML namespaces with the key of prefixes and the value the URIspublic Map<String,String> getNamespaces()
NamespaceAware
getNamespaces
in interface NamespaceAware
Apache Camel