Package net.sf.saxon.functions
Class StandardFunction
java.lang.Object
net.sf.saxon.functions.StandardFunction
This class contains static data tables defining the properties of standard functions. "Standard functions"
here means the XPath 2.0 functions, the XSLT 2.0 functions, and a few selected extension functions
which need special recognition.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
An entry in the table describing the properties of a function -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic void
arg
(StandardFunction.Entry e, int a, ItemType type, int cardinality, Value resultIfEmpty) Add information to a function entry about the argument types of the functionstatic StandardFunction.Entry
getFunction
(String name, int arity) Get the table entry for the function with a given namestatic StandardFunction.Entry
makeEntry
(String name, Class implementationClass, int opcode, int minArguments, int maxArguments, ItemType itemType, int cardinality, int applicability) Make a table entry describing the signature of a function, with a reference to the implementation class.static StandardFunction.Entry
register
(String name, Class implementationClass, int opcode, int minArguments, int maxArguments, ItemType itemType, int cardinality, int applicability) Register a system function in the table of function details.
-
Field Details
-
EMPTY
-
CORE
public static final int CORECategories of functions, bit significant- See Also:
-
XSLT
public static final int XSLT- See Also:
-
USE_WHEN
public static final int USE_WHEN- See Also:
-
XQUPDATE
public static final int XQUPDATE- See Also:
-
XPATH30
public static final int XPATH30- See Also:
-
INTERNAL
public static final int INTERNAL- See Also:
-
XSLT30
public static final int XSLT30- See Also:
-
SAME_AS_FIRST_ARGUMENT
-
-
Method Details
-
register
public static StandardFunction.Entry register(String name, Class implementationClass, int opcode, int minArguments, int maxArguments, ItemType itemType, int cardinality, int applicability) Register a system function in the table of function details.- Parameters:
name
- the function nameimplementationClass
- the class used to implement the functionopcode
- identifies the function when a single class implements several functionsminArguments
- the minimum number of arguments requiredmaxArguments
- the maximum number of arguments alloweditemType
- the item type of the result of the functioncardinality
- the cardinality of the result of the functionapplicability
- the host languages (and versions thereof) in which this function is available- Returns:
- the entry describing the function. The entry is incomplete, it does not yet contain information about the function arguments.
-
makeEntry
public static StandardFunction.Entry makeEntry(String name, Class implementationClass, int opcode, int minArguments, int maxArguments, ItemType itemType, int cardinality, int applicability) Make a table entry describing the signature of a function, with a reference to the implementation class.- Parameters:
name
- the function nameimplementationClass
- the class used to implement the functionopcode
- identifies the function when a single class implements several functionsminArguments
- the minimum number of arguments requiredmaxArguments
- the maximum number of arguments alloweditemType
- the item type of the result of the functioncardinality
- the cardinality of the result of the functionapplicability
- the host languages (and versions of) in which this function is available- Returns:
- the entry describing the function. The entry is incomplete, it does not yet contain information about the function arguments.
-
arg
public static void arg(StandardFunction.Entry e, int a, ItemType type, int cardinality, Value resultIfEmpty) Add information to a function entry about the argument types of the function- Parameters:
e
- the entry for the functiona
- the position of the argument, counting from zerotype
- the item type of the argumentcardinality
- the cardinality 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.
-
getFunction
Get the table entry for the function with a given name- Parameters:
name
- the name of the function. This may be an unprefixed local-name for functions in the system namespace, or may use the conventional prefix "saxon:" in the case of Saxon extension functions that are specially recognizedarity
- the number of arguments of the function- Returns:
- if the function name is known, an Entry containing information about the function. Otherwise, null
-