| java.lang.Object org.apache.xml.dtm.DTMManager org.apache.xpath.XPathContext
XPathContext | public class XPathContext extends DTMManager (Code) | | Default class for the runtime execution context for XPath.
This class extends DTMManager but does not directly implement it.
|
Method Summary | |
public DTMIterator | createDTMIterator(Object xpathCompiler, int pos) Create a new DTMIterator based on an XPath
UnionExpr.
Parameters: xpathCompiler - ??? Somehow we need to pass in a subpart of theexpression. | public DTMIterator | createDTMIterator(String xpathString, PrefixResolver presolver) Create a new DTMIterator based on an XPath
UnionExpr.
Parameters: xpathString - Must be a valid string expressing aUnionExpr. Parameters: presolver - An object that can resolve prefixes to namespace URLs. | public DTMIterator | createDTMIterator(int whatToShow, DTMFilter filter, boolean entityReferenceExpansion) Create a new DTMIterator based only on a whatToShow and
a DTMFilter. | public DTMIterator | createDTMIterator(int node) Create a new DTMIterator that holds exactly one node.
Parameters: node - The node handle that the DTMIterator will iterate to. | public DTM | createDocumentFragment() Creates an empty DocumentFragment object. | public Stack | getAxesIteratorStackStacks() | final public int | getContextNode() Get the current context node. | final public DTMIterator | getContextNodeList() Get the current context node list. | public Stack | getContextNodeListsStack() | final public DTMIterator | getContextNodes() Get the current context node list. | final public int | getCurrentExpressionNode() Get the current node that is the expression's context (i.e. | public IntStack | getCurrentExpressionNodeStack() | final public int | getCurrentNode() Get the current context node. | public org.apache.xpath.axes.SubContextList | getCurrentNodeList() Get the current node list
as defined by the XSLT spec. | public IntStack | getCurrentNodeStack() | public DTM | getDTM(javax.xml.transform.Source source, boolean unique, DTMWSFilter wsfilter, boolean incremental, boolean doIndexing) Get an instance of a DTM, loaded with the content from the
specified source. | public DTM | getDTM(int nodeHandle) Get an instance of a DTM that "owns" a node handle. | public int | getDTMHandleFromNode(org.w3c.dom.Node node) Given a W3C DOM node, try and return a DTM handle.
Note: calling this may be non-optimal.
Parameters: node - Non-null reference to a DOM node. | public int | getDTMIdentity(DTM dtm) | public DTMManager | getDTMManager() Return the DTMManager object. | public DTMXRTreeFrag | getDTMXRTreeFrag(int dtmIdentity) Gets DTMXRTreeFrag object if one has already been created.
Creates new DTMXRTreeFrag object and adds to m_DTMXRTreeFrags HashMap,
otherwise. | final public ErrorListener | getErrorListener() Get the ErrorListener where errors and warnings are to be reported. | public ExpressionContext | getExpressionContext() The the expression context for extensions for this context. | public DTM | getGlobalRTFDTM() Get a DTM to be used as a container for a global Result Tree
Fragment. | final public int | getIteratorRoot() Get the current location path iterator root. | final public PrefixResolver | getNamespaceContext() Get the current namespace context for the xpath. | public Object | getOwnerObject() Get the "owner" context of this context, which should be,
in the case of XSLT, the Transformer object. | final public int | getPredicatePos() | final public int | getPredicateRoot() Get the current predicate root. | final public XMLReader | getPrimaryReader() Get primary XMLReader associated with this execution context. | public DTM | getRTFDTM() Get a DTM to be used as a container for a dynamic Result Tree
Fragment. | public SourceLocator | getSAXLocator() Get the current locater in the stylesheet. | final public SourceTreeManager | getSourceTreeManager() Get the SourceTreeManager associated with this execution context. | public SubContextList | getSubContextList() Get the current axes iterator, or return null if none. | final public URIResolver | getURIResolver() Get the URIResolver associated with this execution context. | final public VariableStack | getVarStack() Get the variable stack, which is in charge of variables and
parameters. | public boolean | isSecureProcessing() | final public void | popContextNodeList() Pop the current context node list. | final public void | popCurrentExpressionNode() Pop the current node that is the expression's context
(i.e. | final public void | popCurrentNode() Pop the current context node. | final public void | popCurrentNodeAndExpression() Set the current context node. | final public void | popExpressionState() Pop the current context node, expression node, and prefix resolver. | final public void | popIteratorRoot() Pop the current location path iterator root. | final public void | popNamespaceContext() Pop the current namespace context for the xpath. | final public void | popPredicatePos() | final public void | popPredicateRoot() Pop the current predicate root. | public void | popRTFContext() Pop the RTFDTM's context mark. | public void | popSAXLocator() Pop the current locater. | final public void | popSubContextList() Pop the last pushed axes iterator. | final public void | pushContextNodeList(DTMIterator nl) Set the current context node list. | final public void | pushCurrentExpressionNode(int n) Set the current node that is the expression's context (i.e. | final public void | pushCurrentNode(int n) Set the current context node. | final public void | pushCurrentNodeAndExpression(int cn, int en) Set the current context node and expression node. | final public void | pushExpressionState(int cn, int en, PrefixResolver nc) Push the current context node, expression node, and prefix resolver. | final public void | pushIteratorRoot(int n) Set the current location path iterator root. | final public void | pushNamespaceContext(PrefixResolver pr) Push a current namespace context for the xpath. | final public void | pushNamespaceContextNull() Just increment the namespace contest stack, so that setNamespaceContext
can be used on the slot. | final public void | pushPredicatePos(int n) | final public void | pushPredicateRoot(int n) Set the current predicate root. | public void | pushRTFContext() Push the RTFDTM's context mark, to allows discarding RTFs added after this
point. | public void | pushSAXLocator(SourceLocator location) Set the current locater in the stylesheet. | public void | pushSAXLocatorNull() Push a slot on the locations stack so that setSAXLocator can be
repeatedly called. | final public void | pushSubContextList(SubContextList iter) Push a TreeWalker on the stack. | public boolean | release(DTM dtm, boolean shouldHardDelete) Release a DTM either to a lru pool, or completely remove reference.
DTMs without system IDs are always hard deleted.
State: experimental.
Parameters: dtm - The DTM to be released. Parameters: shouldHardDelete - True if the DTM should be removed no matter what. | public void | reset() Reset for new run. | public void | setAxesIteratorStackStacks(Stack s) | public void | setContextNodeListsStack(Stack s) | public void | setCurrentExpressionNodeStack(IntStack nv) | public void | setCurrentNodeStack(IntStack nv) | public void | setErrorListener(ErrorListener listener) Set the ErrorListener where errors and warnings are to be reported. | final public void | setNamespaceContext(PrefixResolver pr) Get the current namespace context for the xpath. | public void | setPrimaryReader(XMLReader reader) Set primary XMLReader associated with this execution context. | public void | setSAXLocator(SourceLocator location) Set the current locater in the stylesheet. | public void | setSecureProcessing(boolean flag) | public void | setSourceTreeManager(SourceTreeManager mgr) Set the SourceTreeManager associated with this execution context. | public void | setURIResolver(URIResolver resolver) Set the URIResolver associated with this execution context. | final public void | setVarStack(VariableStack varStack) Get the variable stack, which is in charge of variables and
parameters. |
RECURSIONLIMIT | final public static int RECURSIONLIMIT(Code) | | The ammount to use for stacks that record information during the
recursive execution.
|
expressionContext | XPathExpressionContext expressionContext(Code) | | |
m_dtmManager | protected DTMManager m_dtmManager(Code) | | Though XPathContext context extends
the DTMManager, it really is a proxy for this object, which
is the real DTMManager.
|
m_primaryReader | public XMLReader m_primaryReader(Code) | | The reader of the primary source tree.
|
XPathContext | public XPathContext()(Code) | | Create an XPathContext instance.
|
XPathContext | public XPathContext(Object owner)(Code) | | Create an XPathContext instance.
Parameters: owner - Value that can be retrieved via the getOwnerObject() method. See Also: XPathContext.getOwnerObject |
createDTMIterator | public DTMIterator createDTMIterator(Object xpathCompiler, int pos)(Code) | | Create a new DTMIterator based on an XPath
UnionExpr.
Parameters: xpathCompiler - ??? Somehow we need to pass in a subpart of theexpression. I hate to do this with strings, since the larger expressionhas already been parsed. Parameters: pos - The position in the expression. The newly created DTMIterator . |
createDTMIterator | public DTMIterator createDTMIterator(String xpathString, PrefixResolver presolver)(Code) | | Create a new DTMIterator based on an XPath
UnionExpr.
Parameters: xpathString - Must be a valid string expressing aUnionExpr. Parameters: presolver - An object that can resolve prefixes to namespace URLs. The newly created DTMIterator . |
createDTMIterator | public DTMIterator createDTMIterator(int whatToShow, DTMFilter filter, boolean entityReferenceExpansion)(Code) | | Create a new DTMIterator based only on a whatToShow and
a DTMFilter. The traversal semantics are defined as the descendant
access.
Parameters: whatToShow - This flag specifies which node types may appear inthe logical view of the tree presented by the iterator. See thedescription of NodeFilter for the set of possibleSHOW_ values.These flags can be combined usingOR . Parameters: filter - The NodeFilter to be used with thisTreeWalker , or null to indicate no filter. Parameters: entityReferenceExpansion - The value of this flag determineswhether entity reference nodes are expanded. The newly created NodeIterator . |
createDTMIterator | public DTMIterator createDTMIterator(int node)(Code) | | Create a new DTMIterator that holds exactly one node.
Parameters: node - The node handle that the DTMIterator will iterate to. The newly created DTMIterator . |
createDocumentFragment | public DTM createDocumentFragment()(Code) | | Creates an empty DocumentFragment object.
A new DocumentFragment handle . |
getAxesIteratorStackStacks | public Stack getAxesIteratorStackStacks()(Code) | | |
getContextNode | final public int getContextNode()(Code) | | Get the current context node.
The current context node. |
getContextNodeList | final public DTMIterator getContextNodeList()(Code) | | Get the current context node list.
the current node list,also refered to here as a context node list. |
getContextNodeListsStack | public Stack getContextNodeListsStack()(Code) | | |
getContextNodes | final public DTMIterator getContextNodes()(Code) | | Get the current context node list.
An iterator for the current context list, asdefined in XSLT. |
getCurrentExpressionNode | final public int getCurrentExpressionNode()(Code) | | Get the current node that is the expression's context (i.e. for current() support).
The current sub-expression node. |
getCurrentExpressionNodeStack | public IntStack getCurrentExpressionNodeStack()(Code) | | |
getCurrentNode | final public int getCurrentNode()(Code) | | Get the current context node.
the current node. |
getDTM | public DTM getDTM(javax.xml.transform.Source source, boolean unique, DTMWSFilter wsfilter, boolean incremental, boolean doIndexing)(Code) | | Get an instance of a DTM, loaded with the content from the
specified source. If the unique flag is true, a new instance will
always be returned. Otherwise it is up to the DTMManager to return a
new instance or an instance that it already created and may be being used
by someone else.
(I think more parameters will need to be added for error handling, and entity
resolution).
Parameters: source - 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. Parameters: unique - true if the returned DTM must be unique, probably because itis going to be mutated. Parameters: wsfilter - Enables filtering of whitespace nodes, and may be null. Parameters: incremental - true if the construction should try and be incremental. Parameters: doIndexing - true if the caller considers it worth it to use indexing schemes. a non-null DTM reference. |
getDTM | public DTM getDTM(int nodeHandle)(Code) | | Get an instance of a DTM that "owns" a node handle.
Parameters: nodeHandle - the nodeHandle. a non-null DTM reference. |
getDTMHandleFromNode | public int getDTMHandleFromNode(org.w3c.dom.Node node)(Code) | | Given a W3C DOM node, try and return a DTM handle.
Note: calling this may be non-optimal.
Parameters: node - Non-null reference to a DOM node. a valid DTM handle. |
getDTMIdentity | public int getDTMIdentity(DTM dtm)(Code) | | %TBD% Doc
|
getDTMManager | public DTMManager getDTMManager()(Code) | | Return the DTMManager object. Though XPathContext context extends
the DTMManager, it really is a proxy for the real DTMManager. If a
caller needs to make a lot of calls to the DTMManager, it is faster
if it gets the real one from this function.
|
getDTMXRTreeFrag | public DTMXRTreeFrag getDTMXRTreeFrag(int dtmIdentity)(Code) | | Gets DTMXRTreeFrag object if one has already been created.
Creates new DTMXRTreeFrag object and adds to m_DTMXRTreeFrags HashMap,
otherwise.
Parameters: dtmIdentity - DTMXRTreeFrag |
getErrorListener | final public ErrorListener getErrorListener()(Code) | | Get the ErrorListener where errors and warnings are to be reported.
A non-null ErrorListener reference. |
getExpressionContext | public ExpressionContext getExpressionContext()(Code) | | The the expression context for extensions for this context.
An object that implements the ExpressionContext. |
getGlobalRTFDTM | public DTM getGlobalRTFDTM()(Code) | | Get a DTM to be used as a container for a global Result Tree
Fragment. This will always be an instance of (derived from? equivalent to?)
SAX2DTM, since each RTF is constructed by temporarily redirecting our SAX
output to it. It may be a single DTM containing for multiple fragments,
if the implementation supports that.
Note: The distinction between this method and getRTFDTM() is that the latter
allocates space from the dynamic variable stack (m_rtfdtm_stack), which may
be pruned away again as the templates which defined those variables are exited.
Global variables may be bound late (see XUnresolvedVariable), and never want to
be discarded, hence we need to allocate them separately and don't actually need
a stack to track them.
a non-null DTM reference. |
getIteratorRoot | final public int getIteratorRoot()(Code) | | Get the current location path iterator root.
|
getNamespaceContext | final public PrefixResolver getNamespaceContext()(Code) | | Get the current namespace context for the xpath.
the current prefix resolver for resolving prefixes to namespace URLs. |
getOwnerObject | public Object getOwnerObject()(Code) | | Get the "owner" context of this context, which should be,
in the case of XSLT, the Transformer object. This is needed
so that XSLT functions can get the Transformer.
The owner object passed into the constructor, or null. |
getPredicatePos | final public int getPredicatePos()(Code) | | |
getPredicateRoot | final public int getPredicateRoot()(Code) | | Get the current predicate root.
|
getPrimaryReader | final public XMLReader getPrimaryReader()(Code) | | Get primary XMLReader associated with this execution context.
The reader of the primary source tree. |
getRTFDTM | public DTM getRTFDTM()(Code) | | Get a DTM to be used as a container for a dynamic Result Tree
Fragment. This will always be an instance of (derived from? equivalent to?)
SAX2DTM, since each RTF is constructed by temporarily redirecting our SAX
output to it. It may be a single DTM containing for multiple fragments,
if the implementation supports that.
a non-null DTM reference. |
getSAXLocator | public SourceLocator getSAXLocator()(Code) | | Get the current locater in the stylesheet.
The location within the stylesheet, or null if not known. |
getSourceTreeManager | final public SourceTreeManager getSourceTreeManager()(Code) | | Get the SourceTreeManager associated with this execution context.
the SourceTreeManager associated with this execution context. |
getSubContextList | public SubContextList getSubContextList()(Code) | | Get the current axes iterator, or return null if none.
the sub-context node list. |
getURIResolver | final public URIResolver getURIResolver()(Code) | | Get the URIResolver associated with this execution context.
a URI resolver, which may be null. |
getVarStack | final public VariableStack getVarStack()(Code) | | Get the variable stack, which is in charge of variables and
parameters.
the variable stack, which should not be null. |
isSecureProcessing | public boolean isSecureProcessing()(Code) | | Return the state of the secure processing feature
|
popContextNodeList | final public void popContextNodeList()(Code) | | Pop the current context node list.
|
popCurrentExpressionNode | final public void popCurrentExpressionNode()(Code) | | Pop the current node that is the expression's context
(i.e. for current() support).
|
popCurrentNode | final public void popCurrentNode()(Code) | | Pop the current context node.
|
popCurrentNodeAndExpression | final public void popCurrentNodeAndExpression()(Code) | | Set the current context node.
|
popExpressionState | final public void popExpressionState()(Code) | | Pop the current context node, expression node, and prefix resolver.
|
popIteratorRoot | final public void popIteratorRoot()(Code) | | Pop the current location path iterator root.
|
popNamespaceContext | final public void popNamespaceContext()(Code) | | Pop the current namespace context for the xpath.
|
popPredicatePos | final public void popPredicatePos()(Code) | | |
popPredicateRoot | final public void popPredicateRoot()(Code) | | Pop the current predicate root.
|
popRTFContext | public void popRTFContext()(Code) | | Pop the RTFDTM's context mark. This discards any RTFs added after the last
mark was set.
If there is no RTF DTM, there's nothing to pop so this
becomes a no-op. If pushes were issued before this was called, we count on
the fact that popRewindMark is defined such that overpopping just resets
to empty.
Complicating factor: We need to handle the case of popping back to a previous
RTF DTM, if one of the weird produce-an-RTF-to-build-an-RTF cases arose.
Basically: If pop says this DTM is now empty, then return to the previous
if one exists, in whatever state we left it in. UGLY, but hopefully the
situation which forces us to consider this will arise exceedingly rarely.
|
popSAXLocator | public void popSAXLocator()(Code) | | Pop the current locater.
|
popSubContextList | final public void popSubContextList()(Code) | | Pop the last pushed axes iterator.
|
pushContextNodeList | final public void pushContextNodeList(DTMIterator nl)(Code) | | Set the current context node list.
Parameters: nl - the current node list,also refered to here as a context node list. |
pushCurrentExpressionNode | final public void pushCurrentExpressionNode(int n)(Code) | | Set the current node that is the expression's context (i.e. for current() support).
Parameters: n - The sub-expression node to be current. |
pushCurrentNode | final public void pushCurrentNode(int n)(Code) | | Set the current context node.
Parameters: n - the current node. |
pushCurrentNodeAndExpression | final public void pushCurrentNodeAndExpression(int cn, int en)(Code) | | Set the current context node and expression node.
Parameters: cn - the current node. Parameters: en - the sub-expression context node. |
pushExpressionState | final public void pushExpressionState(int cn, int en, PrefixResolver nc)(Code) | | Push the current context node, expression node, and prefix resolver.
Parameters: cn - the current node. Parameters: en - the sub-expression context node. Parameters: nc - the namespace context (prefix resolver. |
pushIteratorRoot | final public void pushIteratorRoot(int n)(Code) | | Set the current location path iterator root.
|
pushNamespaceContext | final public void pushNamespaceContext(PrefixResolver pr)(Code) | | Push a current namespace context for the xpath.
Parameters: pr - the prefix resolver to be used for resolving prefixes to namespace URLs. |
pushNamespaceContextNull | final public void pushNamespaceContextNull()(Code) | | Just increment the namespace contest stack, so that setNamespaceContext
can be used on the slot.
|
pushPredicatePos | final public void pushPredicatePos(int n)(Code) | | |
pushPredicateRoot | final public void pushPredicateRoot(int n)(Code) | | Set the current predicate root.
|
pushRTFContext | public void pushRTFContext()(Code) | | Push the RTFDTM's context mark, to allows discarding RTFs added after this
point. (If it doesn't exist we don't push, since we might still be able to
get away with not creating it. That requires that excessive pops be harmless.)
|
pushSAXLocator | public void pushSAXLocator(SourceLocator location)(Code) | | Set the current locater in the stylesheet.
Parameters: location - The location within the stylesheet. |
pushSAXLocatorNull | public void pushSAXLocatorNull()(Code) | | Push a slot on the locations stack so that setSAXLocator can be
repeatedly called.
|
pushSubContextList | final public void pushSubContextList(SubContextList iter)(Code) | | Push a TreeWalker on the stack.
Parameters: iter - A sub-context AxesWalker. |
release | public boolean release(DTM dtm, boolean shouldHardDelete)(Code) | | Release a DTM either to a lru pool, or completely remove reference.
DTMs without system IDs are always hard deleted.
State: experimental.
Parameters: dtm - The DTM to be released. Parameters: shouldHardDelete - True if the DTM should be removed no matter what. true if the DTM was removed, false if it was put back in a lru pool. |
reset | public void reset()(Code) | | Reset for new run.
|
setAxesIteratorStackStacks | public void setAxesIteratorStackStacks(Stack s)(Code) | | |
setContextNodeListsStack | public void setContextNodeListsStack(Stack s)(Code) | | |
setCurrentExpressionNodeStack | public void setCurrentExpressionNodeStack(IntStack nv)(Code) | | |
setErrorListener | public void setErrorListener(ErrorListener listener) throws IllegalArgumentException(Code) | | Set the ErrorListener where errors and warnings are to be reported.
Parameters: listener - A non-null ErrorListener reference. |
setNamespaceContext | final public void setNamespaceContext(PrefixResolver pr)(Code) | | Get the current namespace context for the xpath.
Parameters: pr - the prefix resolver to be used for resolving prefixes to namespace URLs. |
setPrimaryReader | public void setPrimaryReader(XMLReader reader)(Code) | | Set primary XMLReader associated with this execution context.
Parameters: reader - The reader of the primary source tree. |
setSAXLocator | public void setSAXLocator(SourceLocator location)(Code) | | Set the current locater in the stylesheet.
Parameters: location - The location within the stylesheet. |
setSecureProcessing | public void setSecureProcessing(boolean flag)(Code) | | Set the state of the secure processing feature
|
setSourceTreeManager | public void setSourceTreeManager(SourceTreeManager mgr)(Code) | | Set the SourceTreeManager associated with this execution context.
Parameters: mgr - the SourceTreeManager to be associated with this execution context. |
setURIResolver | public void setURIResolver(URIResolver resolver)(Code) | | Set the URIResolver associated with this execution context.
Parameters: resolver - the URIResolver to be associated with this execution context, may be null to clear an already set resolver. |
setVarStack | final public void setVarStack(VariableStack varStack)(Code) | | Get the variable stack, which is in charge of variables and
parameters.
Parameters: varStack - non-null reference to the variable stack. |
|
|