org.apache.commons.jxpath
Class ClassFunctions
java.lang.Object
org.apache.commons.jxpath.ClassFunctions
- Functions
public class ClassFunctions
extends java.lang.Object
Extension functions provided by a Java class.
Let's say, we declared a ClassFunction like this:
new ClassFunctions(Integer.class, "int")
We can now use XPaths like:
"int:new(3)"
new Integer(3)
"int:getInteger('foo')"
Integer.getInteger("foo")
"int:floatValue(int:new(4))"
new Integer(4).floatValue()
If the first argument of a method is ExpressionContext, the
expression context in which the function is evaluated is passed to
the method.
$Revision: 1.9 $ $Date: 2004/02/29 14:17:42 $
Function | getFunction(String namespace, String name, Object[] parameters) - Returns a Function, if any, for the specified namespace,
name and parameter types.
|
Set | getUsedNamespaces() - Returns a set of one namespace - the one specified in the constructor.
|
ClassFunctions
public ClassFunctions(Class functionClass,
String namespace)
getFunction
public Function getFunction(String namespace,
String name,
Object[] parameters)
Returns a Function, if any, for the specified namespace,
name and parameter types.
- getFunction in interface Functions
namespace
- if it is not the namespace specified in the constructor,
the method returns nullname
- is a function name or "new" for a constructor.
- a MethodFunction, a ConstructorFunction or null if there is no
such function.
getUsedNamespaces
public Set getUsedNamespaces()
Returns a set of one namespace - the one specified in the constructor.
- getUsedNamespaces in interface Functions