net.sf.saxon.functions

Class SystemFunction

public abstract class SystemFunction extends FunctionCall

Abstract superclass for system-defined and user-defined functions
Field Summary
protected intoperation
Method Summary
protected voidaddContextDocumentArgument(int pos, String augmentedName)
Add an implicit argument referring to the context document.
voidcheckArguments(StaticContext env)
Method called during static type checking
intcomputeCardinality()
Determine the cardinality of the function.
intcomputeSpecialProperties()
Determine the special properties of this expression.
voiddisplay(int level, NamePool pool, PrintStream out)
Diagnostic print of expression structure
protected StandardFunction.EntrygetDetails()
Get the details
StringgetErrorCodeForTypeErrors()
Return the error code to be used for type errors
ItemTypegetItemType(TypeHierarchy th)
Determine the item type of the value returned by the function
protected SequenceTypegetRequiredType(int arg)
Get the required type of the nth argument
static voidmain(String[] args)
The main() method of this class is not intended to be called, it merely tells the code inspection tools in IDEA that the constructors of each function class are actual entry points
static FunctionCallmakeSystemFunction(String name, int arity, NamePool pool)
Make a system function (one in the standard function namespace).
voidsetDetails(StandardFunction.Entry entry)
Set the details of this type of function
protected voiduseContextItemAsDefault()
Set "." as the default value for the first and only argument.

Field Detail

operation

protected int operation

Method Detail

addContextDocumentArgument

protected final void addContextDocumentArgument(int pos, String augmentedName)
Add an implicit argument referring to the context document. Called by functions such as id() and key() that take the context document as an implicit argument

checkArguments

public void checkArguments(StaticContext env)
Method called during static type checking

computeCardinality

public int computeCardinality()
Determine the cardinality of the function.

computeSpecialProperties

public int computeSpecialProperties()
Determine the special properties of this expression. The general rule is that a system function call is non-creative if its return type is atomic, or if all its arguments are non-creative. This is overridden for the generate-id() function, which is considered creative if its operand is creative (because the result depends on the identity of the operand)

display

public void display(int level, NamePool pool, PrintStream out)
Diagnostic print of expression structure

getDetails

protected StandardFunction.Entry getDetails()
Get the details

getErrorCodeForTypeErrors

public String getErrorCodeForTypeErrors()
Return the error code to be used for type errors

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the item type of the value returned by the function

Parameters: th

getRequiredType

protected SequenceType getRequiredType(int arg)
Get the required type of the nth argument

main

public static void main(String[] args)
The main() method of this class is not intended to be called, it merely tells the code inspection tools in IDEA that the constructors of each function class are actual entry points

makeSystemFunction

public static FunctionCall makeSystemFunction(String name, int arity, NamePool pool)
Make a system function (one in the standard function namespace).

Parameters: name The local name of the function. It may also be a lexical QName for a recognized built-in function, e.g. saxon:evaluate, in which case the prefix is hard-coded.

Returns: a FunctionCall that implements this function, if it exists, or null if the function is unknown.

setDetails

public void setDetails(StandardFunction.Entry entry)
Set the details of this type of function

useContextItemAsDefault

protected final void useContextItemAsDefault()
Set "." as the default value for the first and only argument. Called from subclasses.