Package net.sf.saxon.expr.flwor
Class Clause
java.lang.Object
net.sf.saxon.expr.flwor.Clause
- Direct Known Subclasses:
- CountClause,- DiagnosticClause,- ForClause,- GroupByClause,- LetClause,- OrderByClause,- TraceClause,- WhereClause,- WhileClause,- WindowClause
A "Clause" refers specifically to one of the clauses of a FLWOR expression, for example the "for"
 clause, the "let" clause, the "where" or "order by" clause. (The "return" clause, however, is not
 modelled as a Clause).
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract voidaddToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet) Collect information about the navigation paths followed by this clause, for document projection purposesbooleanDetermine whether the clause contains a reference to a local variable binding that cannot be inlinedabstract Clausecopy(FLWORExpression flwor, RebindingMap rebindings) Create a copy of this clauseabstract voidDiagnostic print of expression structure.voidgatherVariableReferences(ExpressionVisitor visitor, Binding binding, List<VariableReference> refs) Build a list of all references to a variables declared in this clauseabstract Clause.ClauseNameGet a keyword identifying what kind of clause this isGet the location, which can be used to determine the system ID and line number of the clauseabstract TuplePullgetPullStream(TuplePull base, XPathContext context) Get a pull-mode tuple stream that implements the functionality of this clause, taking its input from another tuple stream which this clause modifiesabstract TuplePushgetPushStream(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 streamGet the variables bound by this clauseGet information for inclusion in trace outputbooleanvoidoptimize(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) Optimize any expressions contained within this clauseabstract voidprocessOperands(OperandProcessor processor) Process the subexpressions of this clausevoidrefineVariableType(ExpressionVisitor visitor, List<VariableReference> references, Expression returnExpr) Supply improved type information to the expressions that contain references to the variables declared in this clausevoidsetLocation(Location locationId) Set the location, which can be used to determine the system ID and line number of the clausevoidvoidsetRepeated(boolean repeated) Get a short string representation of the clausevoidtypeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) Type-check any expression contained within this clause
- 
Constructor Details- 
Clausepublic Clause()
 
- 
- 
Method Details- 
getLocationGet the location, which can be used to determine the system ID and line number of the clause- Returns:
- the location, or Loc.NONEif not known
 
- 
setLocationSet the location, which can be used to determine the system ID and line number of the clause- Parameters:
- locationId- the location
 
- 
setPackageData
- 
getPackageData
- 
getConfiguration
- 
setRepeatedpublic void setRepeated(boolean repeated) 
- 
isRepeatedpublic boolean isRepeated()
- 
copyCreate a copy of this clause- Parameters:
- flwor- the new FLWORExpression to contain the copied clause. Note that this will not have been fully initialized.
- rebindings- the rebinding map
- Returns:
- the copied clause
 
- 
optimizepublic void optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException Optimize any expressions contained within this clause- Parameters:
- visitor- the ExpressionVisitor, providing access to static context information
- contextItemType- the type of the context item
- Throws:
- XPathException- if any error is detected
 
- 
typeCheckpublic void typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException Type-check any expression contained within this clause- Parameters:
- visitor- the ExpressionVisitor, providing access to static context information
- contextInfo- static information about the dynamic context
- Throws:
- XPathException- if any error is detected
 
- 
getPullStreamGet a pull-mode tuple stream that implements the functionality of this clause, taking its input from another tuple stream which this clause modifies- Parameters:
- base- the input tuple stream
- context- the dynamic evaluation context
- Returns:
- the output tuple stream
 
- 
getPushStreampublic abstract 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- Parameters:
- destination- the output tuple stream
- output- the destination for the result
- context- the dynamic evaluation context
- Returns:
- the push tuple stream that implements the functionality of this clause of the FLWOR expression
 
- 
processOperandsProcess the subexpressions of this clause- Parameters:
- processor- the expression processor used to process the subexpressions
- Throws:
- XPathException- if any error is detected
 
- 
explainDiagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.- Parameters:
- out- the expression presenter used to display the structure
- Throws:
- XPathException- if any error occurs
 
- 
getRangeVariablesGet the variables bound by this clause- Returns:
- the variable bindings
 
- 
gatherVariableReferencespublic void gatherVariableReferences(ExpressionVisitor visitor, Binding binding, List<VariableReference> refs) Build a list of all references to a variables declared in this clause- Parameters:
- visitor- the expression visitor
- binding- a variable declared in this clause
- refs- the list of variable references, initially empty, to which the method will append
 
- 
containsNonInlineableVariableReferenceDetermine whether the clause contains a reference to a local variable binding that cannot be inlined- Parameters:
- binding- the binding for the local variable in question
- Returns:
- true if this clause uses the variable in a way that does not permit inlining
 
- 
refineVariableTypepublic 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- Parameters:
- visitor- the expression visitor
- references- the list of variable references
- returnExpr- the expression in the return clause
 
- 
addToPathMapCollect information about the navigation paths followed by this clause, for document projection purposes- Parameters:
- pathMap- the path map in which the data is to be collected
- pathMapNodeSet- the path map node set representing the paths to the context item
 
- 
getClauseKeyGet a keyword identifying what kind of clause this is- Returns:
- the kind of clause
 
- 
toShortStringGet a short string representation of the clause- Returns:
- a recognizable string
 
- 
getTraceInfoGet information for inclusion in trace output- Returns:
- a map containing the properties to be output
 
 
-