public class GroovyScriptEngineImpl extends AbstractScriptEngine implements Compilable, Invocable
contextARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME| Constructor and Description |
|---|
GroovyScriptEngineImpl() |
GroovyScriptEngineImpl(GroovyClassLoader classLoader) |
| 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) |
GroovyClassLoader |
getClassLoader() |
ScriptEngineFactory |
getFactory() |
<T> T |
getInterface(Class<T> clazz) |
<T> T |
getInterface(Object thiz,
Class<T> clazz) |
Object |
invokeFunction(String name,
Object... args) |
Object |
invokeMethod(Object thiz,
String name,
Object... args) |
void |
setClassLoader(GroovyClassLoader classLoader) |
eval, eval, eval, eval, get, getBindings, getContext, getScriptContext, put, setBindings, setContextpublic GroovyScriptEngineImpl()
public GroovyScriptEngineImpl(GroovyClassLoader classLoader)
public Object eval(Reader reader, ScriptContext ctx) throws ScriptException
eval in interface ScriptEngineScriptExceptionpublic Object eval(String script, ScriptContext ctx) throws ScriptException
eval in interface ScriptEngineScriptExceptionpublic Bindings createBindings()
createBindings in interface ScriptEnginepublic ScriptEngineFactory getFactory()
getFactory in interface ScriptEnginepublic CompiledScript compile(String scriptSource) throws ScriptException
compile in interface CompilableScriptExceptionpublic CompiledScript compile(Reader reader) throws ScriptException
compile in interface CompilableScriptExceptionpublic Object invokeFunction(String name, Object... args) throws ScriptException, NoSuchMethodException
invokeFunction in interface InvocableScriptExceptionNoSuchMethodExceptionpublic Object invokeMethod(Object thiz, String name, Object... args) throws ScriptException, NoSuchMethodException
invokeMethod in interface InvocableScriptExceptionNoSuchMethodExceptionpublic <T> T getInterface(Class<T> clazz)
getInterface in interface Invocablepublic <T> T getInterface(Object thiz, Class<T> clazz)
getInterface in interface Invocablepublic void setClassLoader(GroovyClassLoader classLoader)
public GroovyClassLoader getClassLoader()