Package net.sf.saxon.functions.registry
Interface FunctionDefinition
-
- All Known Implementing Classes:
BuiltInFunctionSet.Entry,MemoFunction,UserFunction,XQueryFunction
public interface FunctionDefinitionAFunctionDefinitionrepresents 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExpressiongetDefaultValueExpression(int i)Get the default value expression of the Nth parameter, if anyStructuredQNamegetFunctionName()Get the name of the functionintgetMinimumArity()Get the number of mandatory arguments (the lower bound of the arity range)intgetNumberOfParameters()Get the number of declared parameters (the upper bound of the arity range)StructuredQNamegetParameterName(int i)Get the name (keyword) of the Nth parameterintgetPositionOfParameter(StructuredQName name)Get the position in the parameter list of a given parameter name
-
-
-
Method Detail
-
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
StructuredQName getParameterName(int i)
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
Expression getDefaultValueExpression(int i)
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
int getPositionOfParameter(StructuredQName name)
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
-
-