net.sf.saxon.instruct
Interface CallableFunction

All Known Implementing Classes:
FunctionInstr, UserFunction

public interface CallableFunction

A callable (XSLT or XQuery) function


Method Summary
 Value call(Value[] actualArgs, Controller controller, boolean evaluateTailCalls)
          Call this function.
 java.lang.String getFunctionName()
          Get the name of the function, for diagnostics
 

Method Detail

getFunctionName

public java.lang.String getFunctionName()
Get the name of the function, for diagnostics

Returns:
the function name, as a lexical QName

call

public Value call(Value[] actualArgs,
                  Controller controller,
                  boolean evaluateTailCalls)
           throws javax.xml.transform.TransformerException
Call this function.

Parameters:
actualArgs - the arguments supplied to the function. These must have the correct types required by the function signature (it is the caller's responsibility to check this). It is acceptable to supply a Closure to represent a value whose evaluation will be delayed until it is needed. The array must be the correct size to match the number of arguments: again, it is the caller's responsibility to check this.
controller - This provides the run-time context for evaluating the function.
evaluateTailCalls - if true, then any function calls contained in the body of the function are evaluated in the normal way, whether or not they are marked as tail calls. If the argument is false, then tail calls are not evaluated, and instead a FunctionCallPackage is returned containing the information needed to evaluate the function. The caller must then be prepared to deal with this returned value by evaluating the packaged function call (which may return further packaged function calls, and so on).
Returns:
a Value representing the result of the function.
javax.xml.transform.TransformerException