|
|||||||
| 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
public class 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, NEED_INDEX_INFO, NO_CONTEXT_ID, SINGLE_STEP_EXECUTION |
| Constructor Summary | |
|---|---|
InternalFunctionCall(Function f)
|
|
| Method Summary | |
|---|---|
void |
accept(ExpressionVisitor visitor)
Start traversing the expression tree using the specified ExpressionVisitor. |
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(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()
|
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(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(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. |
String |
toString()
|
| Methods inherited from class org.exist.xquery.Function |
|---|
createFunction, setPrimaryAxis |
| Methods inherited from class org.exist.xquery.PathExpr |
|---|
getSource, replaceExpression, 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
ExpressionDependency.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 Expressioneval in class FunctioncontextSequence - the current context sequence.contextItem - a single item, taken from context. This defines the item,
the expression should work on.
XPathExceptionpublic int getArgumentCount()
Function
getArgumentCount in class Functionpublic QName getName()
Function
getName in class Functionpublic int returnsType()
ExpressionType. If the return type cannot be determined
statically, return Type.ITEM.
returnsType in interface ExpressionreturnsType in class Functionpublic int getCardinality()
AbstractExpressionCardinality.EXACTLY_ONE.
getCardinality in interface ExpressiongetCardinality in class Function
public void analyze(AnalyzeContextInfo contextInfo)
throws XPathException
Expression
analyze in interface Expressionanalyze in class FunctionXPathExceptionpublic void setParent(Expression parent)
Function
setParent in class Functionpublic Expression getParent()
Function
getParent in class Functionpublic XQueryContext getContext()
getContext in interface CompiledXQuerygetContext in class PathExprXQueryContext used to create this querypublic void setASTNode(XQueryAST ast)
setASTNode in interface ExpressionsetASTNode in class Functionpublic XQueryAST getASTNode()
ExpressionXQueryAST 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 ExpressiongetASTNode in class Functionpublic void add(Expression s)
PathExpr
add in class PathExprpublic void add(PathExpr path)
PathExpr
add in class PathExprpublic void addPath(PathExpr path)
PathExpr
addPath in class PathExprpublic void addPredicate(Predicate pred)
PathExpr
addPredicate in class PathExprpublic void dump(ExpressionDumper dumper)
ExpressionExpressionDumper.
dump in interface Expressiondump in class Functiondumper - the expression dumper to write topublic void dump(Writer writer)
CompiledXQuery
dump in interface CompiledXQuerydump in class PathExprpublic Expression getArgument(int pos)
Function
getArgument in class Function
public Sequence[] getArguments(Sequence contextSequence,
Item contextItem)
throws XPathException
getArguments in class FunctionXPathExceptionpublic DocumentSet getContextDocSet()
getContextDocSet in interface ExpressiongetContextDocSet in class AbstractExpressionpublic int getDependencies()
AbstractExpressionDependency.DEFAULT_DEPENDENCIES.
getDependencies in interface ExpressiongetDependencies in class FunctionExpression.getDependencies()public DocumentSet getDocumentSet()
getDocumentSet in class PathExprpublic Expression getExpression(int pos)
getExpression in class PathExprpublic Expression getLastExpression()
getLastExpression in class PathExprpublic int getLength()
getLength in class PathExprpublic String getLiteralValue()
getLiteralValue in class PathExprpublic FunctionSignature getSignature()
Function
getSignature in class Functionpublic boolean isCalledAs(String localName)
isCalledAs in class Functionpublic boolean isValid()
CompiledXQuery
isValid in interface CompiledXQueryisValid in class PathExprpublic void replaceLastExpression(Expression s)
replaceLastExpression in class PathExprpublic void reset()
CompiledXQuery
reset in interface CompiledXQueryreset in interface CompiledExpressionreset in class PathExprpublic void resetState()
Expression
resetState in interface ExpressionresetState in class PathExpr
public void setArguments(List arguments)
throws XPathException
Function
setArguments in class FunctionXPathExceptionpublic void setContext(XQueryContext context)
setContext in interface CompiledXQuerysetContext in class PathExprpublic void setContextDocSet(DocumentSet contextSet)
setContextDocSet in interface ExpressionsetContextDocSet in class AbstractExpressionpublic String toString()
toString in class Functionpublic void accept(ExpressionVisitor visitor)
ExpressionExpressionVisitor.
accept in interface Expressionaccept in class Function
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||