public void addGlobalFunction(final String name, final Object object,
final String method) {
try {
final Method javaMethod = object.getClass().getMethod(method,
String.class);
this.engine.addCallbackFunction(new StringFunctor(name) {
@Override
public String call(final String input) {
try {
final Object result = javaMethod.invoke(object, input);
return result == null ? null : result.toString();