public class XPathContext extends DTMManager
This class extends DTMManager but does not directly implement it.
| Modifier and Type | Field and Description |
|---|---|
protected DTMManager |
m_dtmManager
Though XPathContext context extends the DTMManager, it really is a proxy for this object, which
is the real DTMManager.
|
static int |
RECURSIONLIMIT
The ammount to use for stacks that record information during the recursive execution.
|
IDENT_DTM_DEFAULT, IDENT_DTM_NODE_BITS, IDENT_MAX_DTMS, IDENT_NODE_DEFAULT| Constructor and Description |
|---|
XPathContext()
Create an XPathContext instance.
|
XPathContext(boolean recursiveVarContext)
Create an XPathContext instance.
|
| Modifier and Type | Method and Description |
|---|---|
DTMIterator |
createDTMIterator(int whatToShow,
DTMFilter filter,
boolean entityReferenceExpansion)
Create a new
DTMIterator based only on a whatToShow and a DTMFilter. |
DTMIterator |
createDTMIterator(Object xpathCompiler,
int pos)
|
DTMIterator |
createDTMIterator(String xpathString,
PrefixResolver presolver)
|
int |
getCurrentNode()
Get the current context node.
|
DTM |
getDTM(int nodeHandle)
Get the instance of DTM that "owns" a node handle.
|
DTM |
getDTM(Source source,
boolean unique,
boolean incremental,
boolean doIndexing)
Get an instance of a DTM, loaded with the content from the specified source.
|
int |
getDTMHandleFromNode(Node node)
Given a W3C DOM node, try and return a DTM handle.
|
DTMManager |
getDTMManager()
Return the DTMManager object.
|
ErrorListener |
getErrorListener()
Get the ErrorListener where errors and warnings are to be reported.
|
int |
getIteratorRoot()
Get the current location path iterator root.
|
PrefixResolver |
getNamespaceContext()
Get the current namespace context for the xpath.
|
int |
getPredicatePos() |
SubContextList |
getSubContextList()
Get the current axes iterator, or return null if none.
|
URIResolver |
getURIResolver()
Get the URIResolver associated with this execution context.
|
void |
popCurrentNode()
Pop the current context node.
|
void |
popCurrentNodeAndExpression()
Set the current context node.
|
void |
popNamespaceContext()
Pop the current namespace context for the xpath.
|
void |
popPredicatePos() |
void |
popSubContextList()
Pop the last pushed axes iterator.
|
void |
pushCurrentNode(int n)
Set the current context node.
|
void |
pushCurrentNodeAndExpression(int cn)
Set the current context node and expression node.
|
void |
pushNamespaceContext(PrefixResolver pr)
Push a current namespace context for the xpath.
|
void |
pushPredicatePos(int n) |
void |
pushSubContextList(SubContextList iter)
Push a TreeWalker on the stack.
|
void |
reset()
Reset for new run.
|
void |
setErrorListener(ErrorListener listener)
Set the ErrorListener where errors and warnings are to be reported.
|
void |
setNamespaceContext(PrefixResolver pr)
Get the current namespace context for the xpath.
|
void |
setURIResolver(URIResolver resolver)
Set the URIResolver associated with this execution context.
|
newInstanceprotected DTMManager m_dtmManager
public static final int RECURSIONLIMIT
public XPathContext()
XPathContext(boolean) constructor with the value true.public XPathContext(boolean recursiveVarContext)
recursiveVarContext - A boolean value indicating whether the XPath context
needs to support pushing of scopes for variable resolutionpublic DTMManager getDTMManager()
public DTM getDTM(Source source, boolean unique, boolean incremental, boolean doIndexing)
(More parameters may eventually need to be added for error handling and entity resolution, and to better control selection of implementations.)
getDTM in class DTMManagersource - the specification of the source object, which may be null, in which case it is
assumed that node construction will take by some other means.unique - true if the returned DTM must be unique, probably because it is going to be
mutated.incremental - true if the DTM should be built incrementally, if possible.doIndexing - true if the caller considers it worth it to use indexing schemes.public DTM getDTM(int nodeHandle)
getDTM in class DTMManagernodeHandle - the nodeHandle.public int getDTMHandleFromNode(Node node)
getDTMHandleFromNode in class DTMManagernode - Non-null reference to a DOM node.public DTMIterator createDTMIterator(Object xpathCompiler, int pos)
createDTMIterator in class DTMManagerxpathCompiler - ??? Somehow we need to pass in a subpart of the expression. I hate to do
this with strings, since the larger expression has already been parsed.pos - The position in the expression.DTMIterator.public DTMIterator createDTMIterator(String xpathString, PrefixResolver presolver)
createDTMIterator in class DTMManagerxpathString - Must be a valid string expressing a LocationPath or a UnionExpr.presolver - An object that can resolve prefixes to namespace URLs.DTMIterator.public DTMIterator createDTMIterator(int whatToShow, DTMFilter filter, boolean entityReferenceExpansion)
DTMIterator based only on a whatToShow and a DTMFilter. The traversal
semantics are defined as the descendant access.
Note that DTMIterators may not be an exact match to DOM NodeIterators. They are initialized and used in much the same way as a NodeIterator, but their response to document mutation is not currently defined.
createDTMIterator in class DTMManagerwhatToShow - This flag specifies which node types may appear in the logical view of the
tree presented by the iterator. See the description of NodeFilter for the set
of possible SHOW_ values.These flags can be combined using OR
.filter - The NodeFilter to be used with this DTMFilter, or
null to indicate no filter.entityReferenceExpansion - The value of this flag determines whether entity reference
nodes are expanded.DTMIterator.public void reset()
public final ErrorListener getErrorListener()
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException
listener - A non-null ErrorListener reference.IllegalArgumentExceptionpublic final URIResolver getURIResolver()
public void setURIResolver(URIResolver resolver)
resolver - the URIResolver to be associated with this execution context, may be null to
clear an already set resolver.public final int getCurrentNode()
public final void pushCurrentNodeAndExpression(int cn)
cn - the current node.public final void popCurrentNodeAndExpression()
public final void pushCurrentNode(int n)
n - the current node.public final void popCurrentNode()
public final int getIteratorRoot()
public final int getPredicatePos()
public final void pushPredicatePos(int n)
public final void popPredicatePos()
public final PrefixResolver getNamespaceContext()
public final void setNamespaceContext(PrefixResolver pr)
pr - the prefix resolver to be used for resolving prefixes to namespace URLs.public final void pushNamespaceContext(PrefixResolver pr)
pr - the prefix resolver to be used for resolving prefixes to namespace URLs.public final void popNamespaceContext()
public final void pushSubContextList(SubContextList iter)
iter - A sub-context AxesWalker.public final void popSubContextList()
public SubContextList getSubContextList()
Copyright © 2022. All rights reserved.