public class ForClause extends Clause
Clause.ClauseName| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowsEmpty |
protected LocalVariableBinding |
positionVariable |
protected LocalVariableBinding |
rangeVariable |
protected Operand |
sequenceOp |
| Constructor and Description |
|---|
ForClause() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addPredicate(FLWORExpression flwor,
ExpressionVisitor visitor,
ContextItemStaticInfo contextItemType,
Expression condition)
Convert where clause to a predicate.
|
void |
addToPathMap(PathMap pathMap,
PathMap.PathMapNodeSet pathMapNodeSet)
Collect information about the navigation paths followed by this clause, for document projection purposes
|
ForClause |
copy(FLWORExpression flwor,
RebindingMap rebindings)
Create a copy of this clause
|
void |
explain(ExpressionPresenter out)
Diagnostic print of expression structure.
|
void |
gatherVariableReferences(ExpressionVisitor visitor,
Binding binding,
java.util.List<VariableReference> references)
Build a list of all references to a variables declared in this clause
|
Clause.ClauseName |
getClauseKey()
Get a keyword identifying what kind of clause this is
|
LocalVariableBinding |
getPositionVariable()
Get the position variable (the variable bound by the "at" clause)
|
TuplePull |
getPullStream(TuplePull base,
XPathContext context)
Get a tuple stream that implements the functionality of this clause, taking its
input from another tuple stream which this clause modifies
|
TuplePush |
getPushStream(TuplePush destination,
Outputter output,
XPathContext context)
Get a push-mode tuple stream that implements the functionality of this clause, supplying its
output to another tuple stream
|
LocalVariableBinding |
getRangeVariable()
Get the range variable (the primary variable bound by this clause)
|
LocalVariableBinding[] |
getRangeVariables()
Get the number of variables bound by this clause
|
Expression |
getSequence() |
void |
initSequence(FLWORExpression flwor,
Expression sequence) |
boolean |
isAllowingEmpty()
Ask whether the "allowing empty" option is present
|
void |
processOperands(OperandProcessor processor)
Process the subexpressions of this clause
|
void |
refineVariableType(ExpressionVisitor visitor,
java.util.List<VariableReference> references,
Expression returnExpr)
Supply improved type information to the expressions that contain references to the variables declared in this clause
|
void |
setAllowingEmpty(boolean option)
Say whether the "allowing empty" option is present
|
void |
setPositionVariable(LocalVariableBinding binding)
Set the position variable (the variable bound by the "at" clause)
|
void |
setRangeVariable(LocalVariableBinding binding)
Set the range variable (the primary variable bound by this clause)
|
void |
setSequence(Expression sequence) |
java.lang.String |
toShortString()
Get a short string representation of the clause
|
java.lang.String |
toString() |
void |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Type-check the expression
|
containsNonInlineableVariableReference, getConfiguration, getLocation, getPackageData, getTraceInfo, isRepeated, optimize, setLocation, setPackageData, setRepeatedprotected LocalVariableBinding rangeVariable
protected LocalVariableBinding positionVariable
protected Operand sequenceOp
protected boolean allowsEmpty
public Clause.ClauseName getClauseKey()
ClausegetClauseKey in class Clausepublic ForClause copy(FLWORExpression flwor, RebindingMap rebindings)
Clausepublic void initSequence(FLWORExpression flwor, Expression sequence)
public void setSequence(Expression sequence)
public Expression getSequence()
public void setRangeVariable(LocalVariableBinding binding)
binding - the range variablepublic LocalVariableBinding getRangeVariable()
public void setPositionVariable(LocalVariableBinding binding)
binding - the position variable, or null if there is no position variablepublic LocalVariableBinding getPositionVariable()
public LocalVariableBinding[] getRangeVariables()
getRangeVariables in class Clausepublic void setAllowingEmpty(boolean option)
option - true if the "allowing empty" option is presentpublic boolean isAllowingEmpty()
public void typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
typeCheck in class Clausevisitor - the ExpressionVisitor, providing access to static context informationcontextInfo - static information about the dynamic contextXPathException - if any error is detectedpublic TuplePull getPullStream(TuplePull base, XPathContext context)
getPullStream in class Clausebase - the input tuple streamcontext - the XPath dynamic contextpublic TuplePush getPushStream(TuplePush destination, Outputter output, XPathContext context)
getPushStream in class Clausedestination - the output tuple streamoutput - the destination for the resultcontext - the dynamic evaluation contextpublic boolean addPredicate(FLWORExpression flwor, ExpressionVisitor visitor, ContextItemStaticInfo contextItemType, Expression condition) throws XPathException
flwor - the FLWOR expression (sans the relevant part of the where clause)visitor - the expression visitorcontextItemType - the item type of the context itemcondition - the predicate to be added. This will always be a single term (never a composite condition
using "and"), as the where clause is split into separate terms before calling this methodXPathException - if an error is encounteredpublic void processOperands(OperandProcessor processor) throws XPathException
processOperands in class Clauseprocessor - the expression processor used to process the subexpressionsXPathException - if any error is detectedpublic void gatherVariableReferences(ExpressionVisitor visitor, Binding binding, java.util.List<VariableReference> references)
ClausegatherVariableReferences in class Clausevisitor - the expression visitorbinding - a variable declared in this clausereferences - the list of variable references, initially empty, to which the method will appendpublic void refineVariableType(ExpressionVisitor visitor, java.util.List<VariableReference> references, Expression returnExpr)
ClauserefineVariableType in class Clausevisitor - the expression visitorreferences - the list of variable referencesreturnExpr - the expression in the return clausepublic void addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
ClauseaddToPathMap in class ClausepathMap - the path map in which the data is to be collectedpathMapNodeSet - the path map node set representing the paths to the context itempublic void explain(ExpressionPresenter out) throws XPathException
explain in class Clauseout - the expression presenter used to display the structureXPathException - if any error occurspublic java.lang.String toShortString()
ClausetoShortString in class Clausepublic java.lang.String toString()
toString in class java.lang.ObjectCopyright (c) 2004-2022 Saxonica Limited. All rights reserved.