net.sf.saxon.functions
public abstract class SystemFunction extends FunctionCall
Field Summary | |
---|---|
protected int | operation |
Method Summary | |
---|---|
protected void | addContextDocumentArgument(int pos, 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 |
String | getErrorCodeForTypeErrors()
Return the error code to be used for type errors. |
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(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()
Set "." as the default value for the first and only argument. |
Parameters: pos the position of the argument whose default value is ".", zero-based augmentedName 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.
Parameters: pathMap the PathMap to which the expression should be added pathMapNodes 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.
Returns: the pathMapNode representing the focus established by this expression, in the case where this expression is the first operand of a path expression or filter expression
Returns: the copy of the original expression
Returns: information about the function signature
Returns: the error code to be used for type errors in the function call. Normally XPTY0004, but different codes are used for functions such as exactly-one()
Parameters: th the type hierarchy cache
Parameters: arg the number of the argument whose type is requested, zero-based
Returns: the required type of the argument as defined in the function signature
Parameters: name The local name of the function. arguments the arguments to the function call
Returns: a FunctionCall that implements this function, if it exists, or null if the function is unknown.
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.
Parameters: visitor an expression visitor contextItemType 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 ITEM_TYPE
Returns: the original expression, rewritten if appropriate to optimize execution
Throws: XPathException if an error is discovered during this phase (typically a type error)
Parameters: entry information giving details of the function signature