Package net.sf.saxon.functions.registry
Class BuiltInFunctionSet.Entry
- java.lang.Object
-
- net.sf.saxon.functions.registry.BuiltInFunctionSet.Entry
-
- All Implemented Interfaces:
FunctionDefinition
- Enclosing class:
- BuiltInFunctionSet
public static class BuiltInFunctionSet.Entry extends java.lang.Object implements FunctionDefinition
An entry in the table describing the properties of a function
-
-
Field Summary
Fields Modifier and Type Field Description int
cardinality
The cardinality of the result of the functionIntHashMap<Expression>
defaultValueExpressions
An array holding functions to evaluate default arguments.BuiltInFunctionSet
functionSet
The function set in which this function is definedjava.util.function.Supplier<SystemFunction>
implementationFactory
The class containing the implementation of this function (always a subclass of SystemFunction)ItemType
itemType
The item type of the result of the functionint
maxArity
The upper bound of the arity rangeint
minArity
The lower bound of the arity rangeStructuredQName
name
The name of the function as a QNameOptionsParameter
optionDetails
For options parameters, details of the accepted options, their defaults, and required typejava.lang.String[]
paramNames
An array holding the names of the parameters to the functionSequenceType[]
paramTypes
An array holding the types of the parameters to the functionjava.util.function.Function<BuiltInFunctionSet.Entry,BuiltInFunctionSet.Entry>
populator
int
properties
Any additional properties.Sequence[]
resultIfEmpty
An array holding, for each declared argument, the value that is to be returned if an empty sequence as the value of this argument allows the result to be determined irrespective of the values of the other arguments; null if there is no such calculation possibleOperandUsage[]
usage
The syntactic context of each argument for the purposes of streamability analysis
-
Constructor Summary
Constructors Constructor Description Entry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BuiltInFunctionSet.Entry
arg(int a, ItemType type, int options, Sequence resultIfEmpty)
Add information to a function entry about the argument types of the functionvoid
ensurePopulated()
Expression
getDefaultValueExpression(int i)
Get the default value expression of the Nth parameter, if anyStructuredQName
getFunctionName()
Get the name of the functionint
getMinimumArity()
Get the number of mandatory arguments (the lower bound of the arity range)int
getNumberOfParameters()
Get the number of declared parameters (the upper bound of the arity range)StructuredQName
getParameterName(int i)
Get the name (keyword) of the Nth parameterint
getPositionOfParameter(StructuredQName name)
Get the position in the parameter list of a given parameter nameBuiltInFunctionSet.Entry
populate(java.util.function.Supplier<SystemFunction> functionFactory, ItemType itemType, int cardinality, int properties)
BuiltInFunctionSet.Entry
setOptionDetails(OptionsParameter details)
Add details for options parameters (only applies to one argument, the function is expected to know which)
-
-
-
Field Detail
-
name
public StructuredQName name
The name of the function as a QName
-
implementationFactory
public java.util.function.Supplier<SystemFunction> implementationFactory
The class containing the implementation of this function (always a subclass of SystemFunction)
-
populator
public java.util.function.Function<BuiltInFunctionSet.Entry,BuiltInFunctionSet.Entry> populator
-
functionSet
public BuiltInFunctionSet functionSet
The function set in which this function is defined
-
maxArity
public int maxArity
The upper bound of the arity range
-
minArity
public int minArity
The lower bound of the arity range
-
itemType
public ItemType itemType
The item type of the result of the function
-
cardinality
public int cardinality
The cardinality of the result of the function
-
usage
public OperandUsage[] usage
The syntactic context of each argument for the purposes of streamability analysis
-
paramNames
public java.lang.String[] paramNames
An array holding the names of the parameters to the function
-
paramTypes
public SequenceType[] paramTypes
An array holding the types of the parameters to the function
-
resultIfEmpty
public Sequence[] resultIfEmpty
An array holding, for each declared argument, the value that is to be returned if an empty sequence as the value of this argument allows the result to be determined irrespective of the values of the other arguments; null if there is no such calculation possible
-
defaultValueExpressions
public IntHashMap<Expression> defaultValueExpressions
An array holding functions to evaluate default arguments. The array is allocated only if there are parameters with default values defined
-
properties
public int properties
Any additional properties. Various bit settings are defined: for example SAME_AS_FIRST_ARGUMENT indicates that the result type is the same as the type of the first argument
-
optionDetails
public OptionsParameter optionDetails
For options parameters, details of the accepted options, their defaults, and required type
-
-
Method Detail
-
ensurePopulated
public void ensurePopulated()
-
populate
public BuiltInFunctionSet.Entry populate(java.util.function.Supplier<SystemFunction> functionFactory, ItemType itemType, int cardinality, int properties)
-
arg
public BuiltInFunctionSet.Entry arg(int a, ItemType type, int options, Sequence resultIfEmpty)
Add information to a function entry about the argument types of the function- Parameters:
a
- the position of the argument, counting from zerotype
- the item type of the argumentoptions
- the cardinality and usage of the argumentresultIfEmpty
- the value returned by the function if an empty sequence appears as the value of this argument, in the case when this result is unaffected by any other arguments. Supply null if this does not apply.- Returns:
- this entry (to allow chaining)
-
setOptionDetails
public BuiltInFunctionSet.Entry setOptionDetails(OptionsParameter details)
Add details for options parameters (only applies to one argument, the function is expected to know which)
-
getFunctionName
public StructuredQName getFunctionName()
Get the name of the function- Specified by:
getFunctionName
in interfaceFunctionDefinition
- Returns:
- the function name
-
getNumberOfParameters
public int getNumberOfParameters()
Description copied from interface:FunctionDefinition
Get the number of declared parameters (the upper bound of the arity range)- Specified by:
getNumberOfParameters
in interfaceFunctionDefinition
- Returns:
- the number of declared parameters
-
getMinimumArity
public int getMinimumArity()
Get the number of mandatory arguments (the lower bound of the arity range)- Specified by:
getMinimumArity
in interfaceFunctionDefinition
- Returns:
- the number of mandatory arguments
-
getParameterName
public StructuredQName getParameterName(int i)
Get the name (keyword) of the Nth parameter- Specified by:
getParameterName
in interfaceFunctionDefinition
- Parameters:
i
- the position of the required parameter- Returns:
- the expression for computing the value of the Nth parameter
-
getDefaultValueExpression
public Expression getDefaultValueExpression(int i)
Get the default value expression of the Nth parameter, if any- Specified by:
getDefaultValueExpression
in interfaceFunctionDefinition
- 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
public int getPositionOfParameter(StructuredQName name)
Get the position in the parameter list of a given parameter name- Specified by:
getPositionOfParameter
in interfaceFunctionDefinition
- Parameters:
name
- the name of the required parameter- Returns:
- the position of the parameter in the parameter list, or -1 if absent
-
-