public class GroovyScriptEngine extends AbstractScriptEngine implements Compilable, Invocable
ScriptEngine
implementation.context
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME
Constructor and Description |
---|
GroovyScriptEngine() |
Modifier and Type | Method and Description |
---|---|
CompiledScript |
compile(Reader reader) |
CompiledScript |
compile(String scriptSource) |
Bindings |
createBindings() |
Object |
eval(Reader reader,
ScriptContext ctx) |
Object |
eval(String script,
ScriptContext ctx) |
ScriptEngineFactory |
getFactory() |
<T> T |
getInterface(Class<T> clasz) |
<T> T |
getInterface(Object thiz,
Class<T> clasz) |
Object |
invokeFunction(String name,
Object... args) |
Object |
invokeMethod(Object thiz,
String name,
Object... args) |
eval, eval, eval, eval, get, getBindings, getContext, getScriptContext, put, setBindings, setContext
public Object eval(Reader reader, ScriptContext ctx) throws ScriptException
eval
in interface ScriptEngine
ScriptException
public Object eval(String script, ScriptContext ctx) throws ScriptException
eval
in interface ScriptEngine
ScriptException
public Bindings createBindings()
createBindings
in interface ScriptEngine
public ScriptEngineFactory getFactory()
getFactory
in interface ScriptEngine
public CompiledScript compile(String scriptSource) throws ScriptException
compile
in interface Compilable
ScriptException
public CompiledScript compile(Reader reader) throws ScriptException
compile
in interface Compilable
ScriptException
public Object invokeFunction(String name, Object... args) throws ScriptException, NoSuchMethodException
invokeFunction
in interface Invocable
ScriptException
NoSuchMethodException
public Object invokeMethod(Object thiz, String name, Object... args) throws ScriptException, NoSuchMethodException
invokeMethod
in interface Invocable
ScriptException
NoSuchMethodException
public <T> T getInterface(Class<T> clasz)
getInterface
in interface Invocable
public <T> T getInterface(Object thiz, Class<T> clasz)
getInterface
in interface Invocable
Copyright © 2015–2022 SciJava. All rights reserved.