net.sf.saxon.functions

Class StandardFunction

public abstract class StandardFunction extends Object

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
static classStandardFunction.Entry
An entry in the table describing the properties of a function
Field Summary
static intCORE
Categories of functions, bit significant
static intINTERNAL
protected static ItemTypeSAME_AS_FIRST_ARGUMENT
static intUSE_WHEN
static intXQUERY11
static intXQUPDATE
static intXSLT
Method Summary
static voidarg(StandardFunction.Entry e, int a, ItemType type, int cardinality, Value resultIfEmpty)
Add information to a function entry about the argument types of the function
static StandardFunction.EntrygetFunction(String name, int arity)
Get the table entry for the function with a given name
static StandardFunction.EntrymakeEntry(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.

Field Detail

CORE

public static final int CORE
Categories of functions, bit significant

INTERNAL

public static final int INTERNAL

SAME_AS_FIRST_ARGUMENT

protected static ItemType SAME_AS_FIRST_ARGUMENT

USE_WHEN

public static final int USE_WHEN

XQUERY11

public static final int XQUERY11

XQUPDATE

public static final int XQUPDATE

XSLT

public static final int XSLT

Method Detail

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 function a the position of the argument, counting from zero type the item type of the argument cardinality the cardinality of the argument resultIfEmpty 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

public static StandardFunction.Entry getFunction(String name, int arity)
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 recognized

Returns: if the function name is known, an Entry containing information about the function. Otherwise, null

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 name implementationClass the class used to implement the function opcode identifies the function when a single class implements several functions minArguments the minimum number of arguments required maxArguments the maximum number of arguments allowed itemType the item type of the result of the function cardinality the cardinality of the result of the function

Returns: the entry describing the function. The entry is incomplete, it does not yet contain information about the function arguments.