Package net.sf.saxon.functions.registry
Interface FunctionDefinition
- All Known Implementing Classes:
BuiltInFunctionSet.Entry
,MemoFunction
,StreamableUserFunction
,UserFunction
,XQueryFunction
public interface FunctionDefinition
A
FunctionDefinition
represents the declaration of a user-defined function in XQuery or XSLT; in 4.0
a function definition has an arity range. The minimum arity is the number of mandatory parameters,
the maximum arity is the number of optional plus mandatory parameters; optional parameters have a default
value which is supplied as an expression.-
Method Summary
Modifier and TypeMethodDescriptiongetDefaultValueExpression
(int i) Get the default value expression of the Nth parameter, if anyGet the name of the functionint
Get the number of mandatory arguments (the lower bound of the arity range)int
Get the number of declared parameters (the upper bound of the arity range)getParameterName
(int i) Get the name (keyword) of the Nth parameterint
Get the position in the parameter list of a given parameter name
-
Method Details
-
getFunctionName
StructuredQName getFunctionName()Get the name of the function- Returns:
- the function name
-
getNumberOfParameters
int getNumberOfParameters()Get the number of declared parameters (the upper bound of the arity range)- Returns:
- the number of declared parameters
-
getMinimumArity
int getMinimumArity()Get the number of mandatory arguments (the lower bound of the arity range)- Returns:
- the number of mandatory arguments
-
getParameterName
Get the name (keyword) of the Nth parameter- Parameters:
i
- the position of the required parameter- Returns:
- the expression for computing the value of the Nth parameter
-
getDefaultValueExpression
Get the default value expression of the Nth parameter, if any- Parameters:
i
- the position of the required parameter- Returns:
- the expression for computing the value of the Nth parameter, or null if there is none
-
getPositionOfParameter
Get the position in the parameter list of a given parameter name- Parameters:
name
- the name of the required parameter- Returns:
- the position of the parameter in the parameter list, or -1 if absent
-