I am using SimpleTemplateEngine to provide templating support in my Java application. I would like to be able to handle methodMissing within my Java class to dynamically look up functions that are provided by a plugin based token system. I am having trouble figuring out how I can handle methodMissing with the following code:
Map<String, Object> binding = new HashMap<String, Object>();
GroovyShell shell = createShell();
SimpleTemplateEngine st = new SimpleTemplateEngine(shell);
Writable w = t.createTemplate(inputStreamReader).make(binding);
StringWriter content = new StringWriter();
How can I setup methodMissing in this case? I've tried adding a subclass of Closure to the binding, but that doesn't seem to work.