|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.jxpath.ClassFunctions
public class ClassFunctions
Extension functions provided by a Java class. Let's say we declared a ClassFunction like this:
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 Summary | |
---|---|
ClassFunctions(java.lang.Class functionClass,
java.lang.String namespace)
Create a new ClassFunctions. |
Method Summary | |
---|---|
Function |
getFunction(java.lang.String namespace,
java.lang.String name,
java.lang.Object[] parameters)
Returns a Function , if any, for the specified namespace,
name and parameter types. |
java.util.Set |
getUsedNamespaces()
Returns a set of one namespace - the one specified in the constructor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassFunctions(java.lang.Class functionClass, java.lang.String namespace)
functionClass
- Class providing the functionsnamespace
- assigned nsMethod Detail |
---|
public java.util.Set getUsedNamespaces()
getUsedNamespaces
in interface Functions
public Function getFunction(java.lang.String namespace, java.lang.String name, java.lang.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 parameters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |