public final class XPathContext extends Object implements NamespaceContext
NamespaceContext
.
The class is immutable and thread-safe.
Constructor and Description |
---|
XPathContext()
Public ctor.
|
XPathContext(Object... namespaces)
Public ctor with custom namespaces.
|
Modifier and Type | Method and Description |
---|---|
XPathContext |
add(String prefix,
Object namespace)
Add new prefix and namespace.
|
String |
getNamespaceURI(String prefix) |
String |
getPrefix(String namespace) |
Iterator<String> |
getPrefixes(String namespace) |
XPathContext |
merge(NamespaceContext context)
Add new context.
|
public XPathContext()
Since this class is private in the package users won't be able
to see this code and its documentation. That's why all these prefixes
and namespaces should be documented in
XMLDocument.XMLDocument(String)
ctor. When adding/changing this
list - don't forget to document it there.
public XPathContext(Object... namespaces)
namespaces
- List of namespacespublic String getNamespaceURI(@NotNull String prefix)
getNamespaceURI
in interface NamespaceContext
public String getPrefix(@NotNull String namespace)
getPrefix
in interface NamespaceContext
public Iterator<String> getPrefixes(@NotNull String namespace)
getPrefixes
in interface NamespaceContext
public XPathContext add(@NotNull String prefix, @NotNull Object namespace)
prefix
- The prefixnamespace
- The namespacepublic XPathContext merge(@NotNull NamespaceContext context)
context
- The context to merge into this oneCopyright © 2012–2013 jcabi.com. All rights reserved.