|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Base interface implemented by all classes which are part
of an XQuery/XPath expression. The main method is
eval(Sequence, Item)
. Please
read the description there.
Field Summary | |
static int |
DOT_TEST
|
static int |
EXPRESSION_ID_INVALID
Marks an invalid expression id. |
static int |
IGNORE_CONTEXT
|
static int |
IN_PREDICATE
Indicates that the expression is within a predicate or the where clause of a FLWOR. |
static int |
IN_UPDATE
Indicates that the expression is used within an update statement. |
static int |
IN_WHERE_CLAUSE
Indicates that the expression is within a where clause of a FLWOR. |
static int |
NO_CONTEXT_ID
Indicates that no context id is supplied to an expression. |
static int |
SINGLE_STEP_EXECUTION
Indicates that the query engine will call the expression once for every item in the context sequence. |
Method Summary | |
void |
accept(ExpressionVisitor visitor)
Start traversing the expression tree using the specified ExpressionVisitor . |
void |
analyze(AnalyzeContextInfo contextInfo)
Statically analyze the expression and its subexpressions. |
void |
dump(ExpressionDumper dumper)
Write a diagnostic dump of the expression to the passed ExpressionDumper . |
Sequence |
eval(Sequence contextSequence)
Evaluate the expression represented by this object. |
Sequence |
eval(Sequence contextSequence,
Item contextItem)
Evaluate the expression represented by this object. |
XQueryAST |
getASTNode()
Returns the XQueryAST node from which this expression
has been constructed by the parser. |
int |
getCardinality()
The expected cardinality of the return value of the expression. |
DocumentSet |
getContextDocSet()
|
int |
getContextId()
|
int |
getDependencies()
Returns a set of bit-flags, indicating some of the parameters on which this expression depends. |
int |
getExpressionId()
Returns an id which uniquely identifies this expression within the compiled expression tree of the query. |
void |
resetState()
Called to inform an expression that it should reset to its initial state. |
int |
returnsType()
The static return type of the expression. |
void |
setASTNode(XQueryAST ast)
|
void |
setContextDocSet(DocumentSet contextSet)
|
void |
setPrimaryAxis(int axis)
|
Field Detail |
public static final int SINGLE_STEP_EXECUTION
public static final int IN_PREDICATE
public static final int IN_WHERE_CLAUSE
IN_PREDICATE
.
public static final int IN_UPDATE
public static final int DOT_TEST
public static final int NO_CONTEXT_ID
public static final int IGNORE_CONTEXT
public static final int EXPRESSION_ID_INVALID
Method Detail |
public int getExpressionId()
EXPRESSION_ID_INVALID
public void analyze(AnalyzeContextInfo contextInfo) throws XPathException
XPathException
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException
Dependency.CONTEXT_ITEM
bit is set in the bit field returned by getDependencies()
, the eval method will
be called once for every item in the context sequence. The contextItem
parameter will be set to the current item. Otherwise, the eval method will only be called
once for the whole context sequence and contextItem will be null.
eXist tries to process the entire context set in one, single step whenever
possible. Thus, most classes only expect context to contain a list of
nodes which represents the current context of the expression.
The position() function in XPath is an example for an expression,
which requires both, context sequence and context item to be set.
The context sequence might be a node set, a sequence of atomic values or a single
node or atomic value.
contextSequence
- the current context sequence.contextItem
- a single item, taken from context. This defines the item,
the expression should work on.
XPathException
public Sequence eval(Sequence contextSequence) throws XPathException
XPathException
public void setPrimaryAxis(int axis)
public int returnsType()
Type
. If the return type cannot be determined
statically, return Type.ITEM.
public int getCardinality()
Cardinality
.
public int getDependencies()
Dependency
.
public void resetState()
public void accept(ExpressionVisitor visitor)
ExpressionVisitor
.
visitor
- public void dump(ExpressionDumper dumper)
ExpressionDumper
.
dumper
- the expression dumper to write topublic void setContextDocSet(DocumentSet contextSet)
public int getContextId()
public DocumentSet getContextDocSet()
public XQueryAST getASTNode()
XQueryAST
node from which this expression
has been constructed by the parser. This node contains location information
(line number and column) important for error reports.
public void setASTNode(XQueryAST ast)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |