List of usage examples for javax.script ScriptEngine ARGV
String ARGV
To view the source code for javax.script ScriptEngine ARGV.
Click Source Link
From source file:com.galeoconsulting.leonardinius.rest.service.ScriptRunner.java
private ScriptEngine createScriptEngine(String scriptLanguage, Script script) { ScriptEngine engine = engineByLanguage(scriptLanguage); if (engine == null) { throw new IllegalStateException( String.format("Language '%s' script engine could not be found", scriptLanguage)); }// ww w .j a v a 2 s . co m updateBindings(engine, ScriptContext.ENGINE_SCOPE, new HashMap<String, Object>() { { put("log", LOG); put("selfScriptRunner", ScriptRunner.this); } }); engine.getContext().setAttribute(ScriptEngine.FILENAME, scriptName(script.getFilename()), ScriptContext.ENGINE_SCOPE); engine.getContext().setAttribute(ScriptEngine.ARGV, getArgvs(script.getArgv()), ScriptContext.ENGINE_SCOPE); return engine; }