|
||||||||
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
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 interface org.exist.xquery.Expression |
DOT_TEST, EXPRESSION_ID_INVALID, IGNORE_CONTEXT, IN_PREDICATE, IN_UPDATE, IN_WHERE_CLAUSE, NO_CONTEXT_ID, SINGLE_STEP_EXECUTION |
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 . |
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 |
setContextDocSet(DocumentSet contextSet)
|
void |
setExpression(Expression inner)
|
Methods inherited from class org.exist.xquery.AbstractExpression |
eval, getASTNode, getContextDocSet, getContextId, getExpressionId, setASTNode, setPrimaryAxis |
Methods inherited from class java.lang.Object |
equals, 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 Expression
eval
in class AbstractExpression
XPathException
public int returnsType()
Expression
Type
. If the return type cannot be determined
statically, return Type.ITEM.
returnsType
in interface Expression
returnsType
in class AbstractExpression
public void analyze(AnalyzeContextInfo contextInfo) throws XPathException
Expression
XPathException
public void dump(ExpressionDumper dumper)
Expression
ExpressionDumper
.
dumper
- the expression dumper to write topublic int getDependencies()
AbstractExpression
Dependency.DEFAULT_DEPENDENCIES
.
getDependencies
in interface Expression
getDependencies
in class AbstractExpression
Expression.getDependencies()
public int getCardinality()
AbstractExpression
Cardinality.EXACTLY_ONE
.
getCardinality
in interface Expression
getCardinality
in class AbstractExpression
public void setContextDocSet(DocumentSet contextSet)
setContextDocSet
in interface Expression
setContextDocSet
in class AbstractExpression
public void resetState()
Expression
resetState
in interface Expression
resetState
in class AbstractExpression
public void accept(ExpressionVisitor visitor)
Expression
ExpressionVisitor
.
accept
in interface Expression
accept
in class AbstractExpression
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |