|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exist.xquery.AbstractExpression
org.exist.xquery.ExtensionExpression
public class ExtensionExpression
Implements an XQuery extension expression. An extension expression starts with
a list of pragmas, followed by an expression enclosed in curly braces. For evaluation
details check {eval(Sequence, Item).
| Field Summary |
|---|
| Fields inherited from class org.exist.xquery.AbstractExpression |
|---|
column, context, contextDocSet, contextId, line, unordered |
| Fields inherited from interface org.exist.xquery.Expression |
|---|
DOT_TEST, EXPRESSION_ID_INVALID, IGNORE_CONTEXT, IN_NODE_CONSTRUCTOR, IN_PREDICATE, IN_UPDATE, IN_WHERE_CLAUSE, NEED_INDEX_INFO, NO_CONTEXT_ID, NON_STREAMABLE, POSITIONAL_PREDICATE, SINGLE_STEP_EXECUTION, UNORDERED, USE_TREE_TRAVERSAL |
| Constructor Summary | |
|---|---|
ExtensionExpression(XQueryContext context)
|
|
| Method Summary | |
|---|---|
void |
accept(ExpressionVisitor visitor)
Start traversing the expression tree using the specified ExpressionVisitor. |
void |
addPragma(Pragma pragma)
|
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,
Item contextItem)
For every pragma in the list, calls Pragma.before(XQueryContext, Expression) before evaluation. |
int |
getCardinality()
The default cardinality is Cardinality.EXACTLY_ONE. |
int |
getDependencies()
Returns Dependency.DEFAULT_DEPENDENCIES. |
int |
getPrimaryAxis()
|
void |
resetState(boolean postOptimization)
Called to inform an expression that it should reset to its initial state. |
int |
returnsType()
The static return type of the expression. |
void |
setContextDocSet(DocumentSet contextSet)
|
void |
setExpression(Expression inner)
|
void |
setPrimaryAxis(int axis)
|
| Methods inherited from class org.exist.xquery.AbstractExpression |
|---|
allowMixNodesInReturn, eval, getColumn, getContext, getContextDocSet, getContextId, getExpressionId, getLine, getParent, getSource, getSubExpression, getSubExpressionCount, match, needsReset, setASTNode, setContextId, setLocation, simplify |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExtensionExpression(XQueryContext context)
| Method Detail |
|---|
public void setExpression(Expression inner)
public void addPragma(Pragma pragma)
public Sequence eval(Sequence contextSequence,
Item contextItem)
throws XPathException
Pragma.before(XQueryContext, Expression) before evaluation.
The method then tries to call Pragma.eval(Sequence, Item) on every pragma.
If a pragma does not return null for this call, the returned Sequence will become the result
of the extension expression. If more than one pragma returns something for eval, an exception
will be thrown. If all pragmas return null, we call eval on the original expression and return
that.
eval in interface Expressioneval in class AbstractExpressioncontextSequence - the current context sequence.contextItem - a single item, taken from context. This defines the item,
the expression should work on.
XPathExceptionpublic int returnsType()
ExpressionType. If the return type cannot be determined
statically, return Type.ITEM.
returnsType in interface ExpressionreturnsType in class AbstractExpression
public void analyze(AnalyzeContextInfo contextInfo)
throws XPathException
Expression
XPathExceptionpublic void dump(ExpressionDumper dumper)
ExpressionExpressionDumper.
dumper - the expression dumper to write topublic int getDependencies()
AbstractExpressionDependency.DEFAULT_DEPENDENCIES.
getDependencies in interface ExpressiongetDependencies in class AbstractExpressionExpression.getDependencies()public int getCardinality()
AbstractExpressionCardinality.EXACTLY_ONE.
getCardinality in interface ExpressiongetCardinality in class AbstractExpressionpublic void setContextDocSet(DocumentSet contextSet)
setContextDocSet in interface ExpressionsetContextDocSet in class AbstractExpressionpublic void setPrimaryAxis(int axis)
setPrimaryAxis in interface ExpressionsetPrimaryAxis in class AbstractExpressionpublic int getPrimaryAxis()
getPrimaryAxis in interface ExpressiongetPrimaryAxis in class AbstractExpressionpublic void resetState(boolean postOptimization)
Expression
resetState in interface ExpressionresetState in class AbstractExpressionpublic void accept(ExpressionVisitor visitor)
ExpressionExpressionVisitor.
accept in interface Expressionaccept in class AbstractExpression
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||