net.sf.saxon.query
public class XQueryFunction extends Object implements InstructionInfo, Container, Declaration
Constructor Summary | |
---|---|
XQueryFunction()
Create an XQuery function |
Method Summary | |
---|---|
void | addArgument(UserFunctionParameter argument)
Add an argument to the list of arguments |
void | checkReferences(ExpressionVisitor visitor)
Type-check references to this function |
void | compile()
Compile this function to create a run-time definition that can be interpreted (note, this
has nothing to do with Java code generation) |
void | explain(ExpressionPresenter out)
Produce diagnostic output showing the compiled and optimized expression tree for a function |
void | fixupReferences(StaticContext env)
Fix up references to this function |
SequenceType[] | getArgumentTypes()
Get the declared types of the arguments of this function |
Expression | getBody()
Get the body of the function |
int | getColumnNumber()
Return the column number |
int | getColumnNumber(long locationId) |
int | getConstructType()
Get the type of construct. |
int | getContainerGranularity()
Get the granularity of the container. |
String | getDisplayName()
Get the name of the function for display in error messages |
Executable | getExecutable()
Get the executable in which this function is contained |
StructuredQName | getFunctionName()
Get the name of the function as a structured QName |
int | getHostLanguage()
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container |
String | getIdentificationKey()
Get an identifying key for this function, which incorporates the URI and local part of the
function name plus the arity |
static String | getIdentificationKey(String uri, String localName, int arity)
Construct what the identification key would be for a function with given URI, local name, and arity |
static String | getIdentificationKey(StructuredQName qName, int arity)
Construct what the identification key would be for a function with given URI, local name, and arity |
int | getLineNumber()
Get the line number of the instruction in the source stylesheet module.
|
int | getLineNumber(long locationId) |
LocationProvider | getLocationProvider()
Get the LocationProvider allowing location identifiers to be resolved. |
NamespaceResolver | getNamespaceResolver()
Get the namespace context of the instruction. |
int | getNumberOfArguments()
Get the arity of the function |
StructuredQName | getObjectName()
Get a name identifying the object of the expression, for example a function name, template name,
variable name, key name, element name, etc. |
UserFunctionParameter[] | getParameterDefinitions()
Get the definitions of the arguments to this function |
Iterator | getProperties()
Get an iterator over all the properties available. |
Object | getProperty(String name)
Get the value of a particular property of the instruction. |
String | getPublicId()
Return the public identifier for the current document event. |
SequenceType | getResultType()
Get the result type of the function |
StaticContext | getStaticContext()
Get the static context for this function |
String | getSystemId()
Get the system identifier (URI) of the source module containing
the instruction. |
String | getSystemId(long locationId) |
UserFunction | getUserFunction()
Get the callable compiled function contained within this XQueryFunction definition. |
boolean | isMemoFunction()
Find out whether this is a memo function |
boolean | isUpdating()
Ask whether this is an updating function (as defined in XQuery Update) |
void | optimize()
Optimize the body of this function |
void | registerReference(UserFunctionCall ufc)
Register a call on this function |
void | setBody(Expression body)
Set the body of the function |
void | setColumnNumber(int column)
Set the column number of the function declaration |
void | setExecutable(Executable exec)
Set the executable in which this function is contained |
void | setFunctionName(StructuredQName name)
Set the name of the function |
void | setLineNumber(int line)
Set the line number of the function declaration within its module |
void | setMemoFunction(boolean isMemoFunction)
Set that this is, or is not, a memo function. |
void | setResultType(SequenceType resultType)
Set the required result type of the function |
void | setStaticContext(QueryModule env)
Set the static context for this function |
void | setSystemId(String systemId)
Set the system ID of the module containing the function |
void | setUpdating(boolean isUpdating)
Set whether this is an updating function (as defined in XQuery Update) |
Parameters: argument the formal declaration of the argument to be added
Parameters: visitor the expression visitor
Throws: XPathException if errors are found
Parameters: out the destination to be used
Parameters: env the static context
Returns: an array, holding the types of the arguments in order
Returns: the expression making up the body of the function
Returns: The column number, or -1 if none is available.
See Also: XQueryFunction
Returns: 0 for a temporary container created during parsing; 1 for a container that operates at the level of an XPath expression; 2 for a container at the level of a global function or template
Returns: the name of the function as a lexical QName
Returns: the executable
Returns: the name of the function as a structured QName
Returns: an identifying key
Parameters: uri the URI part of the function name localName the local part of the function name arity the number of arguments in the function
Returns: an identifying key
Parameters: qName the name of the function arity the number of arguments
Returns: an identifying key
Returns: the location provider
Returns: the arity (the number of arguments)
Returns: an array of UserFunctionParameter objects, one for each argument
Parameters: name The name of the required property
Returns: The value of the requested property, or null if the property is not available
Returns: A string containing the public identifier, or null if none is available.
See Also: XQueryFunction
Returns: the declared result type
Returns: the static context for the module in which the function is declared
Returns: the compiled function object
Returns: true if this is a memo function
Returns: true if this is an updating function
Parameters: ufc a user function call that references this function.
Parameters: body the expression forming the body of the function
Parameters: column the column number of the function declaration
Parameters: exec the executable
Parameters: name the name of the function as a StructuredQName object
Parameters: line the line number of the function declaration
Parameters: isMemoFunction true if this is a memo function.
Parameters: resultType the declared result type of the function
Parameters: env the static context for the module in which the function is declared
Parameters: systemId the system ID (= base URI) of the module containing the function
Parameters: isUpdating true if this is an updating function