@Override
public Object evaluate(final Object value) {
Object result = value;
Bindings bindings = scriptEngine.getBindings(ScriptContext.GLOBAL_SCOPE);
if (bindings.containsKey(functionName)) {
Invocable invocable;
try {
invocable = (Invocable)scriptEngine;
} catch (ClassCastException exception) {
throw new RuntimeException(exception);
}
try {
result = invocable.invokeFunction(functionName, result);
} catch (NoSuchMethodException exception) {
throw new RuntimeException(exception);
} catch (ScriptException exception) {
throw new RuntimeException(exception);
}