|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.expr.Expression net.sf.saxon.expr.FunctionCall net.sf.saxon.functions.SystemFunction
public abstract class SystemFunction
Abstract superclass for system-defined and user-defined functions
Field Summary |
---|
Fields inherited from class net.sf.saxon.expr.Expression |
---|
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
Constructor Summary | |
---|---|
SystemFunction()
|
Method Summary | |
---|---|
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 |
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 |
Methods inherited from class net.sf.saxon.expr.FunctionCall |
---|
addExternalFunctionCallToPathMap, equals, explain, getArguments, getDisplayName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, preEvaluate, promote, replaceSubExpression, setArguments, setFunctionName, simplify, toString, typeCheck |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SystemFunction()
Method Detail |
---|
public static FunctionCall makeSystemFunction(String name, Expression[] arguments)
name
- The local name of the function.arguments
- the arguments to the function call
public void setDetails(StandardFunction.Entry entry)
entry
- information giving details of the function signaturepublic StandardFunction.Entry getDetails()
public void checkArguments(ExpressionVisitor visitor) throws XPathException
visitor
- the expression visitor
XPathException
public 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 FunctionCall
visitor
- 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_TYPE
XPathException
- if an error is discovered during this phase
(typically a type error)public Expression copy()
copy
in class Expression
public String getErrorCodeForTypeErrors()
public ItemType getItemType(TypeHierarchy th)
getItemType
in class Expression
th
- the type hierarchy cache
public int computeCardinality()
StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
public int computeSpecialProperties()
public 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.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |