public class SystemFunctionCall extends StaticFunctionCall implements Negatable
SystemFunction)EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD| Constructor and Description |
|---|
SystemFunctionCall(SystemFunction target,
Expression[] arguments) |
| Modifier and Type | Method and Description |
|---|---|
PathMap.PathMapNodeSet |
addToPathMap(PathMap pathMap,
PathMap.PathMapNodeSet pathMapNodeSet)
Add a representation of this expression to a PathMap.
|
protected int |
computeCardinality()
Compute the static cardinality of this expression
|
protected int |
computeSpecialProperties()
Compute the special properties of this expression.
|
Expression |
copy()
Copy an expression.
|
void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
ExpressionCompiler |
getExpressionCompiler()
Return the bytecode compiler for this system function call.
|
IntegerValue[] |
getIntegerBounds()
For an expression that returns an integer or a sequence of integers, get
a lower and upper bound on the values of the integers that may be returned, from
static analysis.
|
int |
getIntrinsicDependencies()
Compute the dependencies of an expression, as the union of the
dependencies of its subexpressions.
|
ItemType |
getItemType()
Determine the data type of the expression, if possible.
|
StreamingAdjunct |
getStreamingAdjunct()
Get a class that supports streamed evaluation of this expression
|
SystemFunction |
getTargetFunction()
Get the target function to be called
|
boolean |
isNegatable(TypeHierarchy th)
Check whether this specific instance of the expression is negatable
|
boolean |
isVacuousExpression()
Determine whether this is a vacuous expression as defined in the XQuery update specification
|
Expression |
negate()
Create an expression that returns the negation of this expression
|
Expression |
optimize(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Perform optimisation of an expression and its subexpressions.
|
Expression |
preEvaluate(ExpressionVisitor visitor)
Pre-evaluate a function at compile time.
|
void |
setRetainedStaticContext(RetainedStaticContext rsc)
Set the retained static context
|
Pattern |
toPattern(Configuration config,
boolean is30)
Convert this expression to an equivalent XSLT pattern
|
Expression |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Type-check the expression.
|
Expression |
unordered(boolean retainAllNodes,
boolean forStreaming)
Replace this expression by a simpler expression that delivers the results without regard
to order.
|
call, getFunctionName, getTargetFunction, isCallOn, isCallOnSystemFunctionaddExternalFunctionCallToPathMap, adjustRequiredType, checkArgumentCount, checkArguments, checkFunctionCall, equals, evaluateArguments, getArg, getArguments, getArity, getDisplayName, getExpressionName, getImplementationMethod, getNetCost, getOperanda, hashCode, iterate, operands, pluralArguments, preEvaluateIfConstant, setArg, setArguments, setOperanda, setOperanda, simplifyArguments, toShortString, toStringadoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, clearStreamabilityData, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getHostLanguage, getLocation, getObjectName, getPackageData, getParentExpression, getPosture, getPostureAndSweepIfKnown, getProperties, getProperty, getRetainedStaticContext, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStreamability, getSweep, getSystemId, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isIdentical, isSubtreeExpression, isUpdatingExpression, iterateEvents, makeStreamingAdjunct, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, optimizeForType, process, promote, promoteChildren, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setFiltered, setFlattened, setLocation, setParentExpression, setPostureAndSweep, setRetainedStaticContextLocally, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toStreamingPattern, typeCheckChildren, typeErrorpublic SystemFunctionCall(SystemFunction target, Expression[] arguments)
public void setRetainedStaticContext(RetainedStaticContext rsc)
setRetainedStaticContext in class Expressionrsc - the static context to be retainedpublic Expression preEvaluate(ExpressionVisitor visitor) throws XPathException
preEvaluate in class FunctionCallvisitor - an expression visitorXPathException - if evaluation failspublic Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
typeCheck in class StaticFunctionCallvisitor - the expression visitorcontextInfo - information about the type of the context itemXPathException - if an error is discovered during this phase
(typically a type error)public SystemFunction getTargetFunction()
StaticFunctionCallgetTargetFunction in class StaticFunctionCallpublic int getIntrinsicDependencies()
getIntrinsicDependencies in class Expressionprotected int computeCardinality()
computeCardinality in class StaticFunctionCallStaticProperty.ALLOWS_ZERO_OR_ONE,
StaticProperty.EXACTLY_ONE, StaticProperty.ALLOWS_ONE_OR_MORE,
StaticProperty.ALLOWS_ZERO_OR_MOREprotected int computeSpecialProperties()
StaticProperty. The "special" properties are properties
other than cardinality and dependencies, and most of them relate to properties of node sequences, for
example whether the nodes are in document order.computeSpecialProperties in class Expressionpublic Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
FunctionCallThis method is called after all references to functions and variables have been resolved to the declaration of the function or variable, and after all type checking has been done.
optimize in class FunctionCallvisitor - an expression visitorcontextInfo - the static type of "." at the point where this expression is invoked.
The parameter is set to null if it is known statically that the context item will be undefined.
If the type of the context item is not known statically, the argument is set to
Type.ITEM_TYPEXPathException - if an error is discovered during this phase
(typically a type error)public boolean isVacuousExpression()
ExpressionisVacuousExpression in class Expressionpublic ItemType getItemType()
This method should always return a result, though it may be the best approximation that is available at the time.
getItemType in class StaticFunctionCallpublic Expression copy()
copy in class StaticFunctionCallpublic IntegerValue[] getIntegerBounds()
getIntegerBounds in class Expressionpublic boolean isNegatable(TypeHierarchy th)
isNegatable in interface Negatableth - the TypeHierarchy (in case it's needed)public Expression negate()
negate in interface NegatableUnsupportedOperationException - if isNegatable() returns falsepublic Expression unordered(boolean retainAllNodes, boolean forStreaming) throws XPathException
unordered in class ExpressionretainAllNodes - set to true if the result must contain exactly the same nodes as the
original; set to false if the result can eliminate (or introduce) duplicates.forStreaming - set to true if the result is to be optimized for streamingXPathException - if the rewrite failspublic PathMap.PathMapNodeSet addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
The default implementation of this method assumes that an expression does no navigation other than the navigation done by evaluating its subexpressions, and that the subexpressions are evaluated in the same context as the containing expression. The method must be overridden for any expression where these assumptions do not hold. For example, implementations exist for AxisExpression, ParentExpression, and RootExpression (because they perform navigation), and for the doc(), document(), and collection() functions because they create a new navigation root. Implementations also exist for PathExpression and FilterExpression because they have subexpressions that are evaluated in a different context from the calling expression.
addToPathMap in class ExpressionpathMap - the PathMap to which the expression should be addedpathMapNodeSet - the PathMapNodeSet to which the paths embodied in this expression should be addedpublic Pattern toPattern(Configuration config, boolean is30) throws XPathException
toPattern in class Expressionconfig - the Saxon configurationis30 - true if this is XSLT 3.0XPathException - if conversion is not possiblepublic void export(ExpressionPresenter out)
export in class StaticFunctionCallout - public ExpressionCompiler getExpressionCompiler() throws CannotCompileException
getExpressionCompiler in class StaticFunctionCallCannotCompileException - if it is not possible to generate bytecode for this expressionpublic StreamingAdjunct getStreamingAdjunct()
getStreamingAdjunct in class ExpressionCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.