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(message="prefix can\'t be NULL") String prefix)
getNamespaceURI
in interface NamespaceContext
public String getPrefix(@NotNull(message="namespace can\'t be NULL") String namespace)
getPrefix
in interface NamespaceContext
public Iterator<String> getPrefixes(@NotNull(message="namespaces can\'t be NULL") String namespace)
getPrefixes
in interface NamespaceContext
public XPathContext add(@NotNull(message="prefix can\'t be NULL") String prefix, @NotNull(message="namespace can\'t be NULL") Object namespace)
prefix
- The prefixnamespace
- The namespacepublic XPathContext merge(@NotNull(message="context can\'t be NULL") NamespaceContext context)
context
- The context to merge into this oneCopyright © 2012–2014 jcabi.com. All rights reserved.