public class ClassFunctions extends Object implements Functions
We can now use XPaths like:new ClassFunctions(Integer.class, "int")
"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.
Constructor and Description |
---|
ClassFunctions(Class functionClass,
String namespace)
Create a new ClassFunctions.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public ClassFunctions(Class functionClass, String namespace)
functionClass
- Class providing the functionsnamespace
- assigned nspublic Set getUsedNamespaces()
getUsedNamespaces
in interface Functions
public Function getFunction(String namespace, String name, Object[] parameters)
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.parameters
- Object[] of parametersCopyright © 2001–2015 The Apache Software Foundation. All rights reserved.