Interface XPathFunctionDefinition.FunctionCall
- Enclosing class:
XPathFunctionDefinition
public static interface XPathFunctionDefinition.FunctionCall
Provides the actual implementation of a custom XPath function.
-
Method Summary
-
Method Details
-
call
This method is called at runtime to evaluate the XPath function expression.- Parameters:
contextNode- the context node ornull, if this function doesn't depend on the context. SeeXPathFunctionDefinition.dependsOnContext().arguments- The arguments converted as the corresponding java types. SeeXPathFunctionDefinition.getArgumentTypes().- Returns:
- The result of the function. This should be the corresponding java type of
XPathFunctionDefinition.getResultType(). - Throws:
XPathFunctionException- when any problem during evaluation occurs, like invalid arguments.
-
staticInit
This is called once before the function is evaluated. It can be used to optimize the implementation by doing expensive operations only once and cache the result. This is useful, if the argument of the function is of typeStringand is provided as a String literal in the XPath expression.This is an optional step. The default implementation does nothing.
- Parameters:
arguments- The arguments converted as the corresponding java types. SeeXPathFunctionDefinition.getArgumentTypes(). Note: This array might containnullelements, if the values are not known yet because they are dynamic. Only literal values are available.- Throws:
XPathFunctionException- when any problem during initialization occurs, like invalid arguments.
-