ScriptProxy
is the instance which is used by the framework to execute the script.
public interface Script { public int computeResult(int value); }We can use this code to use a script which implements this interface:
ScriptWrapper<Script> wrapper = new GroovyScriptWrapper<Script>() {}; Script script = wrapper.getScript(); File file = new File(<our script file>); wrapper.installScript(file); int value = script.computeResult(10);Note that a
script
instance is not null even before any script has been installed, because this is a proxy to the effective script.Copyright 2019-2020 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence