<The interface class> scriptInterface = wrapper.getScriptProxy(); scriptInterface.<executeOneMethod>Note that a
script
instance is not null even before any script has been installed, because this is a proxy to the effective script.public interface Script { public int computeResult(int value); }We could perform:
ScriptWrapper<Script> wrapper = new GroovyScriptWrapper<Script>() { }; Script script = wrapper.getScriptProxy(); File file = new File(<our script file>); wrapper.installScript(file); int result = script.computeResult(10);
Copyright 2019-2020 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence