File file = new File(<our script file>); wrapper.installScript(file);Note that you can perform again this method on the same
ScriptWrapper
instance if you want to change the Script. For example this will work:ScriptWrapper<Script> wrapper = new GroovyScriptWrapper<Script>() { }; Script Script = wrapper.getScript(); File file = new File(<our first script file>); wrapper.installScript(file); int value = script.execute(10); file = new File(<our second script file>); value = script.execute(10);
String theContent = "...the script content" wrapper.installScript(theContent);
Copyright 2019-2020 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence