JXPath is a java library for Object Graph Navigation using the XPath syntax.
This requires the libraries commons-jxpath-1.3.jar, commons-beanutils.jar and commons-logging.jar to be in classpath.
The following example shows how to create a function library in JXPath.
//Groups different Functions objects
FunctionLibrary functionLibrary = new FunctionLibrary();
//Register static methods in CaseFormatter as functions for namespace "case"
functionLibrary.addFunctions(new ClassFunctions(CaseFormatter.class, "case"));
//Register static methods in Math as functions for namespace "math"
functionLibrary.addFunctions(new ClassFunctions(Math.class, "math"));
//Access functions from "case" namespace
System.out.println(context.getValue("case:upper('be the coder')"));
System.out.println(context.getValue("case:upper(name)"));
System.out.println(context.getValue("case:lower('BE THE CODER')"));
System.out.println(context.getValue("case:lower(name)"));