public class FunctionProxy extends Function
staticContext| Constructor and Description |
|---|
FunctionProxy()
Constructor: creates an uncommitted FunctionProxy
|
| Modifier and Type | Method and Description |
|---|---|
static Value |
convertJavaObjectToXPath(java.lang.Object result,
Controller controller)
Convert a Java object to an XPath value.
|
NodeEnumeration |
enumerate(Context context,
boolean requireSorted)
Return an enumeration of nodes in a nodeset.
|
Value |
evaluate(Context context)
Evaluate the function.
|
boolean |
evaluateAsBoolean(Context context)
Evaluate an expression as a Boolean.
The result of x.evaluateAsBoolean(c) must be equivalent to x.evaluate(c).asBoolean(); but optimisations are possible when it is known that a boolean result is required, especially in the case of a NodeSet. |
double |
evaluateAsNumber(Context context)
Evaluate an expression as a Number.
The result of x.evaluateAsNumber(c) must be equivalent to x.evaluate(c).asNumber(); but optimisations are possible when it is known that a numeric result is required, especially in the case of a NodeSet. |
java.lang.String |
evaluateAsString(Context context)
Evaluate an expression as a String.
The result of x.evaluateAsString(c) must be equivalent to x.evaluate(c).asString(); but optimisations are possible when it is known that a string result is required, especially in the case of a NodeSet. |
java.lang.Object |
getBestFit(Value[] argValues)
Get the best fit amongst all the candidate methods or constructors
|
int |
getDataType()
Determine the data type of the expression, if possible
|
int |
getDependencies()
Determine which aspects of the context the expression depends on.
|
java.lang.String |
getName()
Get the name of the function
|
Expression |
reduce(int dependencies,
Context context)
Perform a partial evaluation of the expression, by eliminating specified dependencies
on the context.
|
boolean |
setFunctionName(java.lang.Class reqClass,
java.lang.String localName)
setFunctionName: locates the external class and the method (or candidate methods)
to which this function relates.
|
Expression |
simplify()
Simplify the function (by simplifying its arguments)
|
addArgument, checkArgumentCount, display, getNumberOfArgumentscontainsReferences, evaluateAsNodeSet, getStaticContext, indent, isContextDocumentNodeSet, make, outputStringValue, setStaticContext, usesCurrentpublic FunctionProxy()
public boolean setFunctionName(java.lang.Class reqClass,
java.lang.String localName)
The method is also used while calling function-available(). In this case the number of arguments is not known (it will be set to zero). We return true if a match was found, regardless of the number of arguments.
reqClass - The Java class namelocalName - The local name used in the XPath function callpublic int getDataType()
getDataType in class Expressionpublic java.lang.String getName()
public Expression simplify() throws XPathException
simplify in class ExpressionXPathExceptionpublic int getDependencies()
getDependencies in class Expressionpublic Expression reduce(int dependencies, Context context) throws XPathException
reduce in class Expressiondependencies - The dependencies to be removedcontext - The context to be used for the partial evaluationXPathExceptionpublic java.lang.Object getBestFit(Value[] argValues) throws XPathException
XPathExceptionpublic Value evaluate(Context context) throws XPathException
evaluate in class Expressioncontext - The context in which the function is to be evaluatedXPathException - if the function cannot be evaluated.public java.lang.String evaluateAsString(Context context) throws XPathException
ExpressionevaluateAsString in class Expressioncontext - The context in which the expression is to be evaluatedXPathExceptionpublic double evaluateAsNumber(Context context) throws XPathException
ExpressionevaluateAsNumber in class Expressioncontext - The context in which the expression is to be evaluatedXPathExceptionpublic boolean evaluateAsBoolean(Context context) throws XPathException
ExpressionevaluateAsBoolean in class Expressioncontext - The context in which the expression is to be evaluatedXPathExceptionpublic NodeEnumeration enumerate(Context context, boolean requireSorted) throws XPathException
Expressionenumerate in class Expressioncontext - The context in which the expression is to be evaluatedrequireSorted - Indicates whether the nodes are required in document order. If
this is false, they may come in any order, but there will be no duplicates.XPathException - when the expression does not return a nodeset.public static Value convertJavaObjectToXPath(java.lang.Object result, Controller controller) throws XPathException
XPathException