|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.xml.xpath.Function
This class provides the basic common implementation for XPath functions. Functions in XPath must be derived from this class. The basic method of implementing a function is to derive a class from this class and provide one or more public methods for the implementation of the function. If the default invoke() member is not overridden the must be a separate, public member for each combination of arguments (required and optional). The default invoke member() uses introspection to find the methods in derived classes that match the function signature. This method information is cached, and is not calculated until the first invocation. However, better performance can probably be gained by over- riding invoke(). For functions that take different types of arguments, invoke() must be overridden (e.g., XPath's string(), boolean(), number(), and id() functions, which are defined to take any of the four basic types).
FunctionSignature
,
FunctionCall
Constructor Summary | |
protected |
Function(FunctionSignature signature)
Construct a Function with the passed signature |
Method Summary | |
Function |
getInstance(ArgumentList args)
Return an instance of this function that matches the passed argument list. |
protected FunctionSignature |
getSignature()
Return the signature for this Function. |
ExpressionValue |
invoke(Object[] args)
Invoke the function using the passed list of arguments. |
boolean |
isConstant()
Return true if the expression is a constant value. |
void |
registerForReset(XPathResetRegistrar registrar)
Register this expression or any subexpression that implements XPathResetCache with an object that wants to call resetCache() |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Function(FunctionSignature signature)
signature
- Object describing return type, name, and argumentsMethod Detail |
public Function getInstance(ArgumentList args) throws XPathParserException
args
- The argument list
XPathParserException
public ExpressionValue invoke(Object[] args) throws XPathEvaluationException
args
- List of arguments.
XPathEvaluationException
public boolean isConstant()
public void registerForReset(XPathResetRegistrar registrar)
resetCache()
protected FunctionSignature getSignature()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |