com.icl.saxon.expr
Class FunctionProxy
java.lang.Object
|
+--com.icl.saxon.expr.Expression
|
+--com.icl.saxon.expr.Function
|
+--com.icl.saxon.expr.FunctionProxy
- public class FunctionProxy
- extends Function
This class acts as a proxy for an extension function defined as a method
in a user-defined class
Constructor Summary |
FunctionProxy()
Constructor: creates an uncommitted FunctionProxy |
Method Summary |
static Value |
convertJavaObjectToXPath(java.lang.Object result)
|
Value |
eval(java.util.Vector arguments,
Context context)
Evaluate the function. |
int |
getDependencies()
Determine which aspects of the context the expression depends on. |
java.lang.String |
getName()
Get the name of the function |
boolean |
isAvailable(Name fullName)
Determine whether the function is available. |
Expression |
reduce(int dependencies,
Context context)
Perform a partial evaluation of the expression, by eliminating specified dependencies
on the context. |
void |
setMethod(Name fullName)
setMethod: locates the external class and method to which this function relates. |
Methods inherited from class com.icl.saxon.expr.Expression |
containsReferences, enumerate, evaluateAsBoolean, evaluateAsNodeSet, evaluateAsNumber, evaluateAsString, getDataType, getStaticContext, isNumeric, isRelative, make, make, setStaticContext, usesCurrent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FunctionProxy
public FunctionProxy()
- Constructor: creates an uncommitted FunctionProxy
setMethod
public void setMethod(Name fullName)
- setMethod: locates the external class and method to which this function relates. At this
stage addArguments() will have been called, so the number of arguments is known. If no
method of the required name is located, an exception is saved, but it is not thrown until
an attempt is made to evaluate the function.
- Parameters:
fullName
- This identifies both the local name of the function and its namespace.
isAvailable
public boolean isAvailable(Name fullName)
- Determine whether the function is available. This supports the extension-function-available
function, and as such it is done without regard to the number of arguments.
getName
public java.lang.String getName()
- Get the name of the function
- Overrides:
getName
in class Function
- Following copied from class:
com.icl.saxon.expr.Function
- Returns:
- the name of the function, as used in XSL expressions, but excluding
its namespace prefix
getDependencies
public int getDependencies()
- Determine which aspects of the context the expression depends on. The result is
a bitwise-or'ed value composed from constants such as Context.VARIABLES and
Context.CURRENT_NODE
- Overrides:
getDependencies
in class Function
reduce
public Expression reduce(int dependencies,
Context context)
throws org.xml.sax.SAXException
- Perform a partial evaluation of the expression, by eliminating specified dependencies
on the context.
- Overrides:
reduce
in class Function
- Parameters:
dependencies
- The dependencies to be removedcontext
- The context to be used for the partial evaluation- Returns:
- a new expression that does not have any of the specified
dependencies
eval
public Value eval(java.util.Vector arguments,
Context context)
throws org.xml.sax.SAXException
- Evaluate the function.
- Overrides:
eval
in class Function
- Parameters:
arguments
- A Vector, each of whose elements is a Value containing the value of a
supplied argument to the function.context
- The context in which the function is to be evaluated- Returns:
- a Value representing the result of the function.
- Throws:
org.xml.sax.SAXException
- if the function cannot be evaluated.
convertJavaObjectToXPath
public static Value convertJavaObjectToXPath(java.lang.Object result)
throws org.xml.sax.SAXException