|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exist.xquery.AbstractExpression
org.exist.xquery.Step
org.exist.xquery.LocationStep
public class LocationStep
Processes all location path steps (like descendant::*, ancestor::XXX).
The results of the first evaluation of the expression are cached for the
lifetime of the object and only reloaded if the context sequence (as passed
to the eval(Sequence, Item) method) has changed.
| Field Summary | |
|---|---|
protected boolean |
applyPredicate
|
protected CachedResult |
cached
|
protected DocumentSet |
currentDocs
|
protected NodeSet |
currentSet
|
protected boolean |
inUpdate
|
protected UpdateListener |
listener
|
protected boolean |
optimized
|
protected Expression |
parent
|
protected int |
parentDeps
|
protected boolean |
preloadedData
|
protected boolean |
useDirectAttrSelect
|
protected boolean |
useDirectChildSelect
|
| Fields inherited from class org.exist.xquery.Step |
|---|
abbreviatedStep, axis, hasPositionalPredicate, inPredicate, LOG, predicates, staticReturnType, test |
| Fields inherited from class org.exist.xquery.AbstractExpression |
|---|
column, context, contextDocSet, contextId, line, unordered |
| Fields inherited from interface org.exist.xquery.Expression |
|---|
DOT_TEST, EXPRESSION_ID_INVALID, IGNORE_CONTEXT, IN_NODE_CONSTRUCTOR, IN_PREDICATE, IN_UPDATE, IN_WHERE_CLAUSE, NEED_INDEX_INFO, NO_CONTEXT_ID, NON_STREAMABLE, POSITIONAL_PREDICATE, SINGLE_STEP_EXECUTION, UNORDERED, USE_TREE_TRAVERSAL |
| Constructor Summary | |
|---|---|
LocationStep(XQueryContext context,
int axis)
Creates a new LocationStep instance. |
|
LocationStep(XQueryContext context,
int axis,
NodeTest test)
Creates a new LocationStep instance. |
|
| Method Summary | |
|---|---|
void |
accept(ExpressionVisitor visitor)
The method accept |
void |
analyze(AnalyzeContextInfo contextInfo)
Statically analyze the expression and its subexpressions. |
protected Sequence |
applyPredicate(Sequence outerSequence,
Sequence contextSequence)
The method applyPredicate |
Sequence |
eval(Sequence contextSequence,
Item contextItem)
The method eval |
protected Sequence |
getAncestors(XQueryContext context,
Sequence contextSequence)
The method getAncestors |
protected Sequence |
getAttributes(XQueryContext context,
Sequence contextSequence)
The method getAttributes |
protected Sequence |
getChildren(XQueryContext context,
Sequence contextSequence)
The method getChildren |
int |
getDependencies()
Returns Dependency.DEFAULT_DEPENDENCIES. |
protected Sequence |
getDescendants(XQueryContext context,
Sequence contextSequence)
The method getDescendants |
protected DocumentSet |
getDocumentSet(NodeSet contextSet)
The method getDocumentSet |
protected Sequence |
getFollowing(XQueryContext context,
Sequence contextSequence)
The method getFollowing |
Expression |
getParentExpression()
The method getParent |
protected Sequence |
getParents(XQueryContext context,
Sequence contextSequence)
The method getParents |
protected Sequence |
getPreceding(XQueryContext context,
Sequence contextSequence)
The method getPreceding |
protected Sequence |
getSelf(XQueryContext context,
Sequence contextSequence)
The method getSelf |
protected Sequence |
getSiblings(XQueryContext context,
Sequence contextSequence)
The method getSiblings |
protected boolean |
hasPreloadedData()
If the current path expression depends on local variables from a for expression, we can optimize by preloading entire element or attribute sets. |
java.lang.Boolean |
match(Sequence contextSequence,
Item contextItem)
|
protected boolean |
matchAttributes(XQueryContext context,
Sequence contextSequence)
|
protected java.lang.Boolean |
matchChildren(XQueryContext context,
Sequence contextSequence)
|
protected void |
registerUpdateListener()
The method registerUpdateListener |
void |
resetState(boolean postOptimization)
Called to inform an expression that it should reset to its initial state. |
void |
setPreloadedData(DocumentSet docs,
NodeSet nodes)
The method setPreloadedData |
void |
setUseDirectAttrSelect(boolean useDirectAttrSelect)
The method setUseDirectAttrSelect |
| Methods inherited from class org.exist.xquery.Step |
|---|
addPredicate, dump, getAxis, getCardinality, getPredicates, getPrimaryAxis, getTest, hasPredicates, insertPredicate, isAbbreviated, returnsType, setAbbreviated, setAxis, setPrimaryAxis, setTest, toString |
| Methods inherited from class org.exist.xquery.AbstractExpression |
|---|
allowMixNodesInReturn, eval, getColumn, getContext, getContextDocSet, getContextId, getExpressionId, getLine, getParent, getSource, getSubExpression, getSubExpressionCount, needsReset, setASTNode, setContextDocSet, setContextId, setLocation, simplify |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected NodeSet currentSet
protected DocumentSet currentDocs
protected UpdateListener listener
protected Expression parent
protected CachedResult cached
protected int parentDeps
protected boolean preloadedData
protected boolean optimized
protected boolean inUpdate
protected boolean useDirectAttrSelect
protected boolean useDirectChildSelect
protected boolean applyPredicate
| Constructor Detail |
|---|
public LocationStep(XQueryContext context,
int axis)
LocationStep instance.
context - a XQueryContext valueaxis - an int value
public LocationStep(XQueryContext context,
int axis,
NodeTest test)
LocationStep instance.
context - a XQueryContext valueaxis - an int valuetest - a NodeTest value| Method Detail |
|---|
public int getDependencies()
AbstractExpressionDependency.DEFAULT_DEPENDENCIES.
getDependencies in interface ExpressiongetDependencies in class AbstractExpressionExpression.getDependencies()protected boolean hasPreloadedData()
public void setPreloadedData(DocumentSet docs,
NodeSet nodes)
setPreloadedData
docs - a DocumentSet valuenodes - a NodeSet value
protected Sequence applyPredicate(Sequence outerSequence,
Sequence contextSequence)
throws XPathException
applyPredicate
outerSequence - a Sequence valuecontextSequence - a Sequence value
Sequence value
XPathException - if an error occurs
public void analyze(AnalyzeContextInfo contextInfo)
throws XPathException
Expression
analyze in interface Expressionanalyze in class StepXPathException
public Sequence eval(Sequence contextSequence,
Item contextItem)
throws XPathException
eval
eval in interface Expressioneval in class StepcontextSequence - a Sequence valuecontextItem - an Item value
Sequence value
XPathException - if an error occurs
protected Sequence getSelf(XQueryContext context,
Sequence contextSequence)
throws XPathException
getSelf
context - a XQueryContext valuecontextSequence - a NodeSet value
Sequence value
XPathException
protected Sequence getAttributes(XQueryContext context,
Sequence contextSequence)
throws XPathException
getAttributes
context - a XQueryContext valuecontextSequence - a NodeSet value
NodeSet value
XPathException
protected Sequence getChildren(XQueryContext context,
Sequence contextSequence)
throws XPathException
getChildren
context - a XQueryContext valuecontextSequence - the context sequence
NodeSet value
XPathException
protected Sequence getDescendants(XQueryContext context,
Sequence contextSequence)
throws XPathException
getDescendants
context - a XQueryContext valuecontextSequence - the context sequence
NodeSet value
XPathException
protected Sequence getSiblings(XQueryContext context,
Sequence contextSequence)
throws XPathException
getSiblings
context - a XQueryContext valuecontextSequence - a NodeSet value
NodeSet value
XPathException
protected Sequence getPreceding(XQueryContext context,
Sequence contextSequence)
throws XPathException
getPreceding
context - a XQueryContext valuecontextSequence - a Sequence value
NodeSet value
XPathException - if an error occurs
protected Sequence getFollowing(XQueryContext context,
Sequence contextSequence)
throws XPathException
getFollowing
context - a XQueryContext valuecontextSequence - a Sequence value
NodeSet value
XPathException - if an error occurs
protected Sequence getAncestors(XQueryContext context,
Sequence contextSequence)
throws XPathException
getAncestors
context - a XQueryContext valuecontextSequence - a Sequence value
NodeSet value
XPathException
protected Sequence getParents(XQueryContext context,
Sequence contextSequence)
throws XPathException
getParents
context - a XQueryContext valuecontextSequence - a Sequence value
NodeSet value
XPathExceptionprotected DocumentSet getDocumentSet(NodeSet contextSet)
getDocumentSet
contextSet - a NodeSet value
DocumentSet valuepublic Expression getParentExpression()
getParent
Expression valuepublic void setUseDirectAttrSelect(boolean useDirectAttrSelect)
setUseDirectAttrSelect
useDirectAttrSelect - a boolean valueprotected void registerUpdateListener()
registerUpdateListener
public void accept(ExpressionVisitor visitor)
accept
accept in interface Expressionaccept in class AbstractExpressionvisitor - an ExpressionVisitor valuepublic void resetState(boolean postOptimization)
Expression
resetState in interface ExpressionresetState in class Step
public java.lang.Boolean match(Sequence contextSequence,
Item contextItem)
throws XPathException
match in interface Expressionmatch in class AbstractExpressionXPathException
protected java.lang.Boolean matchChildren(XQueryContext context,
Sequence contextSequence)
throws XPathException
XPathException
protected boolean matchAttributes(XQueryContext context,
Sequence contextSequence)
throws XPathException
XPathException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||