Package org.codehaus.groovy.jsr223
Class GroovyScriptEngineImpl
java.lang.Object
javax.script.AbstractScriptEngine
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl
- All Implemented Interfaces:
Compilable
,Invocable
,ScriptEngine
public class GroovyScriptEngineImpl extends AbstractScriptEngine implements Compilable, Invocable
JSR-223 Engine implementation.
Adapted from original by Mike Grogan and A. Sundararajan
-
Field Summary
Fields inherited from interface javax.script.ScriptEngine
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME
-
Constructor Summary
Constructors Constructor Description GroovyScriptEngineImpl()
GroovyScriptEngineImpl(GroovyClassLoader classLoader)
-
Method Summary
Modifier and Type Method 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)
Methods inherited from class javax.script.AbstractScriptEngine
eval, eval, eval, eval, get, getBindings, getContext, getScriptContext, put, setBindings, setContext
-
Constructor Details
-
GroovyScriptEngineImpl
public GroovyScriptEngineImpl() -
GroovyScriptEngineImpl
-
-
Method Details
-
eval
- Specified by:
eval
in interfaceScriptEngine
- Throws:
ScriptException
-
eval
- Specified by:
eval
in interfaceScriptEngine
- Throws:
ScriptException
-
createBindings
- Specified by:
createBindings
in interfaceScriptEngine
-
getFactory
- Specified by:
getFactory
in interfaceScriptEngine
-
compile
- Specified by:
compile
in interfaceCompilable
- Throws:
ScriptException
-
compile
- Specified by:
compile
in interfaceCompilable
- Throws:
ScriptException
-
invokeFunction
public Object invokeFunction(String name, Object... args) throws ScriptException, NoSuchMethodException- Specified by:
invokeFunction
in interfaceInvocable
- Throws:
ScriptException
NoSuchMethodException
-
invokeMethod
public Object invokeMethod(Object thiz, String name, Object... args) throws ScriptException, NoSuchMethodException- Specified by:
invokeMethod
in interfaceInvocable
- Throws:
ScriptException
NoSuchMethodException
-
getInterface
- Specified by:
getInterface
in interfaceInvocable
-
getInterface
- Specified by:
getInterface
in interfaceInvocable
-
setClassLoader
-
getClassLoader
-