import javax.script.*
def engine = new ScriptEngineManager().getEngineByName("groovy");
engine.put('arg', false)
def result = engine.eval("println 'hello'; arg")
println result
指定できる名前
println new ScriptEngineManager().getEngineFactories()*.getNames().flatten()
[groovy, Groovy, js, rhino, JavaScript, javascript, ECMAScript, ecmascript]
0 件のコメント:
コメントを投稿