Package com.jcabi.xml
Class XPathContext
java.lang.Object
com.jcabi.xml.XPathContext
- All Implemented Interfaces:
NamespaceContext
Convenient internal implementation of
NamespaceContext
.
The class is immutable and thread-safe.
- Since:
- 0.1
-
Constructor Summary
ConstructorDescriptionPublic ctor.XPathContext
(Object... namespaces) Public ctor with custom namespaces. -
Method Summary
Modifier and TypeMethodDescriptionAdd new prefix and namespace.getNamespaceURI
(String prefix) getPrefixes
(String namespace) merge
(NamespaceContext context) Add new context.toString()
-
Constructor Details
-
XPathContext
public XPathContext()Public ctor.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(String)
ctor. When adding/changing this list - don't forget to document it there. -
XPathContext
Public ctor with custom namespaces.- Parameters:
namespaces
- List of namespaces
-
-
Method Details
-
toString
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceNamespaceContext
-
getPrefix
- Specified by:
getPrefix
in interfaceNamespaceContext
-
getPrefixes
- Specified by:
getPrefixes
in interfaceNamespaceContext
-
add
Add new prefix and namespace.- Parameters:
prefix
- The prefixnamespace
- The namespace- Returns:
- New context
-
merge
Add new context.- Parameters:
context
- The context to merge into this one- Returns:
- New context
-