|
||||||||
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.PathExpr
org.exist.xquery.Function
org.exist.xquery.InternalFunctionCall
Wrapper for internal modules in order to
perform access control checks on internal
module function calls. It delegates to
the wrapped Function
for
everything, but checks permission before
delegating eval
Field Summary |
Fields inherited from class org.exist.xquery.Function |
BUILTIN_FUNCTION_NS |
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 | |
InternalFunctionCall(Function f)
|
Method Summary | |
void |
add(Expression s)
Add an arbitrary expression to this object's list of child-expressions. |
void |
add(PathExpr path)
Add all the child-expressions from another PathExpr to this object's child-expressions. |
void |
addPath(PathExpr path)
Add another PathExpr to this object's expression list. |
void |
addPredicate(Predicate pred)
Add a predicate expression to the list of expressions. |
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 . |
void |
dump(java.io.Writer writer)
Writes a diagnostic dump of the expression structure to the specified writer. |
Sequence |
eval(Sequence contextSequence,
Item contextItem)
Evaluate the expression represented by this object. |
Expression |
getArgument(int pos)
Get an argument expression by its position in the argument list. |
int |
getArgumentCount()
Get the number of arguments passed to this function. |
Sequence[] |
getArguments(Sequence contextSequence,
Item contextItem)
|
XQueryAST |
getASTNode()
Returns the XQueryAST node from which this expression
has been constructed by the parser. |
int |
getCardinality()
The default cardinality is Cardinality.EXACTLY_ONE . |
XQueryContext |
getContext()
|
DocumentSet |
getContextDocSet()
|
int |
getDependencies()
Returns Dependency.DEFAULT_DEPENDENCIES . |
DocumentSet |
getDocumentSet()
|
Expression |
getExpression(int pos)
|
Expression |
getLastExpression()
|
int |
getLength()
|
java.lang.String |
getLiteralValue()
|
QName |
getName()
Return the name of this function. |
Expression |
getParent()
Returns the expression from which this function gets called. |
FunctionSignature |
getSignature()
Get the signature of this function. |
boolean |
isCalledAs(java.lang.String localName)
|
boolean |
isValid()
Is the compiled expression still valid? Returns false if, for example, the source code of one of the imported modules has changed. |
void |
replaceLastExpression(Expression s)
|
void |
reset()
Reset the compiled expression tree. |
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 |
setArguments(java.util.List arguments)
Set the (static) arguments for this function from a list of expressions. |
void |
setASTNode(XQueryAST ast)
|
void |
setContext(XQueryContext context)
|
void |
setContextDocSet(DocumentSet contextSet)
|
void |
setParent(Expression parent)
Set the parent expression of this function, i.e. |
java.lang.String |
toString()
|
Methods inherited from class org.exist.xquery.Function |
createFunction, setPrimaryAxis |
Methods inherited from class org.exist.xquery.PathExpr |
accept, getSource, setSource |
Methods inherited from class org.exist.xquery.AbstractExpression |
eval, getContextId, getExpressionId |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.exist.xquery.CompiledXQuery |
eval |
Constructor Detail |
public InternalFunctionCall(Function f)
Method Detail |
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException
Expression
Dependency.CONTEXT_ITEM
bit is set in the bit field returned by Expression.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.
eval
in interface Expression
eval
in class Function
XPathException
public int getArgumentCount()
Function
getArgumentCount
in class Function
public QName getName()
Function
getName
in class Function
public int returnsType()
Expression
Type
. If the return type cannot be determined
statically, return Type.ITEM.
returnsType
in interface Expression
returnsType
in class Function
public int getCardinality()
AbstractExpression
Cardinality.EXACTLY_ONE
.
getCardinality
in interface Expression
getCardinality
in class Function
public void analyze(AnalyzeContextInfo contextInfo) throws XPathException
Expression
analyze
in interface Expression
analyze
in class Function
XPathException
public void setParent(Expression parent)
Function
setParent
in class Function
parent
- public Expression getParent()
Function
getParent
in class Function
public XQueryContext getContext()
getContext
in interface CompiledXQuery
getContext
in class PathExpr
public void setASTNode(XQueryAST ast)
setASTNode
in interface Expression
setASTNode
in class Function
public XQueryAST getASTNode()
Expression
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.
getASTNode
in interface Expression
getASTNode
in class Function
public void add(Expression s)
PathExpr
add
in class PathExpr
s
- public void add(PathExpr path)
PathExpr
add
in class PathExpr
path
- public void addPath(PathExpr path)
PathExpr
addPath
in class PathExpr
path
- public void addPredicate(Predicate pred)
PathExpr
addPredicate
in class PathExpr
pred
- public void dump(ExpressionDumper dumper)
Expression
ExpressionDumper
.
dump
in interface Expression
dump
in class Function
public void dump(java.io.Writer writer)
CompiledXQuery
dump
in interface CompiledXQuery
dump
in class PathExpr
public Expression getArgument(int pos)
Function
getArgument
in class Function
pos
- public Sequence[] getArguments(Sequence contextSequence, Item contextItem) throws XPathException
getArguments
in class Function
XPathException
public DocumentSet getContextDocSet()
getContextDocSet
in interface Expression
getContextDocSet
in class AbstractExpression
public int getDependencies()
AbstractExpression
Dependency.DEFAULT_DEPENDENCIES
.
getDependencies
in interface Expression
getDependencies
in class Function
public DocumentSet getDocumentSet()
getDocumentSet
in class PathExpr
public Expression getExpression(int pos)
getExpression
in class PathExpr
public Expression getLastExpression()
getLastExpression
in class PathExpr
public int getLength()
getLength
in class PathExpr
public java.lang.String getLiteralValue()
getLiteralValue
in class PathExpr
public FunctionSignature getSignature()
Function
getSignature
in class Function
public boolean isCalledAs(java.lang.String localName)
isCalledAs
in class Function
public boolean isValid()
CompiledXQuery
isValid
in interface CompiledXQuery
isValid
in class PathExpr
public void replaceLastExpression(Expression s)
replaceLastExpression
in class PathExpr
public void reset()
CompiledXQuery
reset
in interface CompiledXQuery
reset
in class PathExpr
public void resetState()
Expression
resetState
in interface Expression
resetState
in class PathExpr
public void setArguments(java.util.List arguments) throws XPathException
Function
setArguments
in class Function
arguments
-
XPathException
public void setContext(XQueryContext context)
setContext
in interface CompiledXQuery
setContext
in class PathExpr
public void setContextDocSet(DocumentSet contextSet)
setContextDocSet
in interface Expression
setContextDocSet
in class AbstractExpression
public java.lang.String toString()
toString
in class Function
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |