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 CompiledScriptcompile(Reader reader)CompiledScriptcompile(String scriptSource)BindingscreateBindings()Objecteval(Reader reader, ScriptContext ctx)Objecteval(String script, ScriptContext ctx)GroovyClassLoadergetClassLoader()ScriptEngineFactorygetFactory()<T> TgetInterface(Class<T> clazz)<T> TgetInterface(Object thiz, Class<T> clazz)ObjectinvokeFunction(String name, Object... args)ObjectinvokeMethod(Object thiz, String name, Object... args)voidsetClassLoader(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:
evalin interfaceScriptEngine- Throws:
ScriptException
-
eval
- Specified by:
evalin interfaceScriptEngine- Throws:
ScriptException
-
createBindings
- Specified by:
createBindingsin interfaceScriptEngine
-
getFactory
- Specified by:
getFactoryin interfaceScriptEngine
-
compile
- Specified by:
compilein interfaceCompilable- Throws:
ScriptException
-
compile
- Specified by:
compilein interfaceCompilable- Throws:
ScriptException
-
invokeFunction
public Object invokeFunction(String name, Object... args) throws ScriptException, NoSuchMethodException- Specified by:
invokeFunctionin interfaceInvocable- Throws:
ScriptExceptionNoSuchMethodException
-
invokeMethod
public Object invokeMethod(Object thiz, String name, Object... args) throws ScriptException, NoSuchMethodException- Specified by:
invokeMethodin interfaceInvocable- Throws:
ScriptExceptionNoSuchMethodException
-
getInterface
- Specified by:
getInterfacein interfaceInvocable
-
getInterface
- Specified by:
getInterfacein interfaceInvocable
-
setClassLoader
-
getClassLoader
-