org.exist.xquery
Class ForExpr
java.lang.Object
org.exist.xquery.AbstractExpression
org.exist.xquery.BindingExpression
org.exist.xquery.ForExpr
- All Implemented Interfaces:
- Expression
- public class ForExpr
- extends BindingExpression
Represents an XQuery "for" expression.
- Author:
- Wolfgang Meier
Methods inherited from class org.exist.xquery.AbstractExpression |
accept, eval, getASTNode, getCardinality, getContextDocSet, getContextId, getDependencies, getExpressionId, setASTNode, setContextDocSet, setPrimaryAxis |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ForExpr
public ForExpr(XQueryContext context)
setPositionalVariable
public void setPositionalVariable(java.lang.String var)
- A "for" expression may have an optional positional variable whose
QName can be set via this method.
- Parameters:
var
-
analyze
public void analyze(AnalyzeContextInfo contextInfo,
OrderSpec[] orderBy)
throws XPathException
- Specified by:
analyze
in class BindingExpression
- Throws:
XPathException
eval
public Sequence eval(Sequence contextSequence,
Item contextItem,
Sequence resultSequence)
throws XPathException
- This implementation tries to process the "where" clause in advance, i.e. in one single
step. This is possible if the input sequence is a node set and the where expression
has no dependencies on other variables than those declared in this "for" statement.
- Specified by:
eval
in class BindingExpression
- Throws:
XPathException
- See Also:
Expression.eval(Sequence, Item)
dump
public void dump(ExpressionDumper dumper)
- Description copied from interface:
Expression
- Write a diagnostic dump of the expression to the passed
ExpressionDumper
.
- Parameters:
dumper
- the expression dumper to write to
toString
public java.lang.String toString()
returnsType
public int returnsType()
- Description copied from interface:
Expression
- The static return type of the expression.
This method should return one of the type constants defined in class
Type
. If the return type cannot be determined
statically, return Type.ITEM.
- Specified by:
returnsType
in interface Expression
- Overrides:
returnsType
in class BindingExpression
Copyright (C) Wolfgang Meier. All rights reserved.