|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.expr.flwor.Clause net.sf.saxon.expr.flwor.ForClause
public class ForClause
A "for" clause in a FLWOR expression
Field Summary |
---|
Fields inherited from class net.sf.saxon.expr.flwor.Clause |
---|
COUNT, FOR, GROUPBYCLAUSE, LET, ORDERBYCLAUSE, WHERE, WINDOW |
Constructor Summary | |
---|---|
ForClause()
|
Method Summary | |
---|---|
boolean |
addPredicate(ExpressionVisitor visitor,
ExpressionVisitor.ContextItemType contextItemType,
Expression condition)
Convert where clause to a predicate. |
ForClause |
copy()
|
void |
explain(ExpressionPresenter out)
Diagnostic print of expression structure. |
void |
gatherVariableReferences(ExpressionVisitor visitor,
Binding binding,
List<VariableReference> references)
Build a list of all references to a variables declared in this clause |
void |
gatherVariableReferences(List references)
|
int |
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,
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()
Get the expression over which the "for" variable iterates |
boolean |
isAllowingEmpty()
Ask whether the "allowing empty" option is present |
void |
processSubExpressions(ExpressionProcessor processor)
Process the subexpressions of this clause |
void |
refineVariableType(ExpressionVisitor visitor,
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)
Set the expression over which the "for" variable iterates |
String |
toString()
|
void |
typeCheck(ExpressionVisitor visitor)
Type-check the expression |
Methods inherited from class net.sf.saxon.expr.flwor.Clause |
---|
optimize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ForClause()
Method Detail |
---|
public int getClauseKey()
Clause
getClauseKey
in class Clause
public ForClause copy()
copy
in class Clause
public void setSequence(Expression sequence)
sequence
- the expression over which the variable rangespublic Expression getSequence()
public void setRangeVariable(LocalVariableBinding binding)
binding
- the range variablepublic LocalVariableBinding getRangeVariable()
public void setPositionVariable(LocalVariableBinding binding)
binding
- the position variablepublic LocalVariableBinding getPositionVariable()
public LocalVariableBinding[] getRangeVariables()
getRangeVariables
in class Clause
public void setAllowingEmpty(boolean option)
option
- true if the "allowing empty" option is presentpublic boolean isAllowingEmpty()
public void typeCheck(ExpressionVisitor visitor) throws XPathException
typeCheck
in class Clause
visitor
- the ExpressionVisitor, providing access to static context information
XPathException
- if any error is detectedpublic TuplePull getPullStream(TuplePull base, XPathContext context)
getPullStream
in class Clause
base
- the input tuple streamcontext
- the XPath dynamic context
public TuplePush getPushStream(TuplePush destination, XPathContext context)
getPushStream
in class Clause
destination
- the output tuple streamcontext
- the dynamic evaluation context
public boolean addPredicate(ExpressionVisitor visitor, ExpressionVisitor.ContextItemType contextItemType, Expression condition) throws XPathException
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 method
XPathException
- if an error is encounteredpublic void processSubExpressions(ExpressionProcessor processor) throws XPathException
processSubExpressions
in class Clause
processor
- the expression processor used to process the subexpressions
XPathException
- if any error is detectedpublic void gatherVariableReferences(List references)
public void gatherVariableReferences(ExpressionVisitor visitor, Binding binding, List<VariableReference> references)
Clause
gatherVariableReferences
in class Clause
visitor
- 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, List<VariableReference> references, Expression returnExpr)
Clause
refineVariableType
in class Clause
visitor
- the expression visitorreferences
- the list of variable referencesreturnExpr
- the expression in the return clausepublic void explain(ExpressionPresenter out)
explain
in class Clause
out
- the expression presenter used to display the structurepublic String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |