public abstract class SystemFunction extends FunctionCall
| Modifier and Type | Field and Description |
|---|---|
protected int |
operation |
argumentEVALUATE_METHOD, EVENT_FEED_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, PUSH_SELECTION, staticProperties, WATCH_METHOD| Constructor and Description |
|---|
SystemFunction() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addContextDocumentArgument(int pos,
java.lang.String augmentedName)
Add an implicit argument referring to the context document.
|
PathMap.PathMapNodeSet |
addDocToPathMap(PathMap pathMap,
PathMap.PathMapNodeSet pathMapNodes)
Add a representation of a doc() call or similar function to a PathMap.
|
void |
checkArguments(ExpressionVisitor visitor)
Method called during static type checking
|
int |
computeCardinality()
Determine the cardinality of the function.
|
int |
computeSpecialProperties()
Determine the special properties of this expression.
|
Expression |
copy()
Copy an expression.
|
StandardFunction.Entry |
getDetails()
Get the details of the function signature
|
java.lang.String |
getErrorCodeForTypeErrors()
Return the error code to be used for type errors.
|
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
ItemType |
getItemType(TypeHierarchy th)
Determine the item type of the value returned by the function
|
protected SequenceType |
getRequiredType(int arg)
Get the required type of the nth argument
|
static FunctionCall |
makeSystemFunction(java.lang.String name,
Expression[] arguments)
Make a system function call (one in the standard function namespace).
|
Expression |
optimize(ExpressionVisitor visitor,
ItemType contextItemType)
Perform optimisation of an expression and its subexpressions.
|
void |
setDetails(StandardFunction.Entry entry)
Set the details of this type of function
|
protected void |
useContextItemAsDefault(ExpressionVisitor visitor)
Set "." as the default value for the first and only argument.
|
addExternalFunctionCallToPathMap, checkArgumentCount, equals, explain, getArguments, getDisplayName, getExpressionName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, preEvaluate, promote, replaceSubExpression, setArguments, setFunctionName, simplify, simplifyArguments, toString, typeCheckaddToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExecutable, getHostLanguage, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterate, iterateEvents, iterateSameFocusSubExpressions, markTailFunctionCalls, process, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, typeErrorpublic static FunctionCall makeSystemFunction(java.lang.String name, Expression[] arguments)
name - The local name of the function.arguments - the arguments to the function callpublic void setDetails(StandardFunction.Entry entry)
entry - information giving details of the function signaturepublic StandardFunction.Entry getDetails()
public int getImplementationMethod()
getImplementationMethod in class ExpressionExpression.ITERATE_METHOD or Expression.EVALUATE_METHOD or
Expression.PROCESS_METHODpublic void checkArguments(ExpressionVisitor visitor) throws XPathException
checkArguments in class FunctionCallvisitor - the expression visitorXPathExceptionpublic Expression optimize(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException
This 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 visitorcontextItemType - 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 Expression copy()
copy in class Expressionpublic java.lang.String getErrorCodeForTypeErrors()
protected SequenceType getRequiredType(int arg)
arg - the number of the argument whose type is requested, zero-basedpublic ItemType getItemType(TypeHierarchy th)
getItemType in class Expressionth - the type hierarchy cachepublic int computeCardinality()
computeCardinality in class ExpressionStaticProperty.ALLOWS_ZERO_OR_ONE,
StaticProperty.EXACTLY_ONE, StaticProperty.ALLOWS_ONE_OR_MORE,
StaticProperty.ALLOWS_ZERO_OR_MOREpublic int computeSpecialProperties()
computeSpecialProperties in class Expressionprotected final void useContextItemAsDefault(ExpressionVisitor visitor)
visitor - protected final void addContextDocumentArgument(int pos,
java.lang.String augmentedName)
throws XPathException
pos - the position of the argument whose default value is ".", zero-basedaugmentedName - the name to be used for the function call with its extra argument.
There are some cases where user function calls cannot supply the argument directly (notably
unparsed-entity-uri() and unparsed-entity-public-id()) and in these cases a synthesized
function name is used for the new function call.XPathExceptionpublic PathMap.PathMapNodeSet addDocToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodes)
pathMap - the PathMap to which the expression should be addedpathMapNodes - the node in the PathMap representing the focus at the point where this expression
is called. Set to null if this expression appears at the top level.