Package net.sf.saxon.expr.flwor
Class ForMemberClause
- java.lang.Object
-
- net.sf.saxon.expr.flwor.Clause
-
- net.sf.saxon.expr.flwor.ForClause
-
- net.sf.saxon.expr.flwor.ForMemberClause
-
public class ForMemberClause extends ForClause
A "for member" clause in a FLWOR expression (XQuery 4.0: iterates over members of an array)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sf.saxon.expr.flwor.Clause
Clause.ClauseName
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.expr.flwor.ForClause
allowsEmpty, positionVariable, rangeVariable, sequenceOp
-
-
Constructor Summary
Constructors Constructor Description ForMemberClause()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 purposesForMemberClause
copy(FLWORExpression flwor, RebindingMap rebindings)
Create a copy of this clauseClause.ClauseName
getClauseKey()
Get a keyword identifying what kind of clause this isTuplePull
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 modifiesTuplePush
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 streamvoid
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 clausevoid
typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo)
Type-check the expression-
Methods inherited from class net.sf.saxon.expr.flwor.ForClause
explain, gatherVariableReferences, getPositionVariable, getRangeVariable, getRangeVariables, getSequence, initSequence, isAllowingEmpty, processOperands, setAllowingEmpty, setPositionVariable, setRangeVariable, setSequence, toShortString, toString
-
Methods inherited from class net.sf.saxon.expr.flwor.Clause
containsNonInlineableVariableReference, getConfiguration, getLocation, getPackageData, getTraceInfo, isRepeated, optimize, setLocation, setPackageData, setRepeated
-
-
-
-
Method Detail
-
getClauseKey
public Clause.ClauseName getClauseKey()
Description copied from class:Clause
Get a keyword identifying what kind of clause this is- Overrides:
getClauseKey
in classForClause
- Returns:
- the kind of clause
-
copy
public ForMemberClause copy(FLWORExpression flwor, RebindingMap rebindings)
Description copied from class:Clause
Create a copy of this clause
-
typeCheck
public void typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
Type-check the expression- Overrides:
typeCheck
in classForClause
- Parameters:
visitor
- the ExpressionVisitor, providing access to static context informationcontextInfo
- static information about the dynamic context- Throws:
XPathException
- if any error is detected
-
getPullStream
public 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- Overrides:
getPullStream
in classForClause
- Parameters:
base
- the input tuple streamcontext
- the XPath dynamic context- Returns:
- the output tuple stream
-
getPushStream
public 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- Overrides:
getPushStream
in classForClause
- Parameters:
destination
- the output tuple streamoutput
- the destination for the resultcontext
- the dynamic evaluation context- Returns:
- the push tuple stream that implements the functionality of this clause of the FLWOR expression
-
addPredicate
public boolean addPredicate(FLWORExpression flwor, ExpressionVisitor visitor, ContextItemStaticInfo contextItemType, Expression condition) throws XPathException
Convert where clause to a predicate.- Overrides:
addPredicate
in classForClause
- Parameters:
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 method- Returns:
- true if the expression has been changed, that is, if the where clause has been converted
- Throws:
XPathException
- if an error is encountered
-
refineVariableType
public void refineVariableType(ExpressionVisitor visitor, java.util.List<VariableReference> references, Expression returnExpr)
Description copied from class:Clause
Supply improved type information to the expressions that contain references to the variables declared in this clause- Overrides:
refineVariableType
in classForClause
- Parameters:
visitor
- the expression visitorreferences
- the list of variable referencesreturnExpr
- the expression in the return clause
-
addToPathMap
public void addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
Description copied from class:Clause
Collect information about the navigation paths followed by this clause, for document projection purposes- Overrides:
addToPathMap
in classForClause
- Parameters:
pathMap
- the path map in which the data is to be collectedpathMapNodeSet
- the path map node set representing the paths to the context item
-
-