Package org.codehaus.groovy.jsr223
Class GroovyScriptEngineImpl
- java.lang.Object
-
- javax.script.AbstractScriptEngine
-
- org.codehaus.groovy.jsr223.GroovyScriptEngineImpl
-
- All Implemented Interfaces:
javax.script.Compilable
,javax.script.Invocable
,javax.script.ScriptEngine
public class GroovyScriptEngineImpl extends javax.script.AbstractScriptEngine implements javax.script.Compilable, javax.script.Invocable
JSR-223 Engine implementation. Adapted from original by Mike Grogan and A. Sundararajan
-
-
Constructor Summary
Constructors Constructor Description GroovyScriptEngineImpl()
GroovyScriptEngineImpl(GroovyClassLoader classLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.script.CompiledScript
compile(java.io.Reader reader)
javax.script.CompiledScript
compile(java.lang.String scriptSource)
javax.script.Bindings
createBindings()
java.lang.Object
eval(java.io.Reader reader, javax.script.ScriptContext ctx)
java.lang.Object
eval(java.lang.String script, javax.script.ScriptContext ctx)
GroovyClassLoader
getClassLoader()
javax.script.ScriptEngineFactory
getFactory()
<T> T
getInterface(java.lang.Class<T> clazz)
<T> T
getInterface(java.lang.Object thiz, java.lang.Class<T> clazz)
java.lang.Object
invokeFunction(java.lang.String name, java.lang.Object... args)
java.lang.Object
invokeMethod(java.lang.Object thiz, java.lang.String name, java.lang.Object... args)
void
setClassLoader(GroovyClassLoader classLoader)
-
-
-
Constructor Detail
-
GroovyScriptEngineImpl
public GroovyScriptEngineImpl()
-
GroovyScriptEngineImpl
public GroovyScriptEngineImpl(GroovyClassLoader classLoader)
-
-
Method Detail
-
eval
public java.lang.Object eval(java.io.Reader reader, javax.script.ScriptContext ctx) throws javax.script.ScriptException
- Specified by:
eval
in interfacejavax.script.ScriptEngine
- Throws:
javax.script.ScriptException
-
eval
public java.lang.Object eval(java.lang.String script, javax.script.ScriptContext ctx) throws javax.script.ScriptException
- Specified by:
eval
in interfacejavax.script.ScriptEngine
- Throws:
javax.script.ScriptException
-
createBindings
public javax.script.Bindings createBindings()
- Specified by:
createBindings
in interfacejavax.script.ScriptEngine
-
getFactory
public javax.script.ScriptEngineFactory getFactory()
- Specified by:
getFactory
in interfacejavax.script.ScriptEngine
-
compile
public javax.script.CompiledScript compile(java.lang.String scriptSource) throws javax.script.ScriptException
- Specified by:
compile
in interfacejavax.script.Compilable
- Throws:
javax.script.ScriptException
-
compile
public javax.script.CompiledScript compile(java.io.Reader reader) throws javax.script.ScriptException
- Specified by:
compile
in interfacejavax.script.Compilable
- Throws:
javax.script.ScriptException
-
invokeFunction
public java.lang.Object invokeFunction(java.lang.String name, java.lang.Object... args) throws javax.script.ScriptException, java.lang.NoSuchMethodException
- Specified by:
invokeFunction
in interfacejavax.script.Invocable
- Throws:
javax.script.ScriptException
java.lang.NoSuchMethodException
-
invokeMethod
public java.lang.Object invokeMethod(java.lang.Object thiz, java.lang.String name, java.lang.Object... args) throws javax.script.ScriptException, java.lang.NoSuchMethodException
- Specified by:
invokeMethod
in interfacejavax.script.Invocable
- Throws:
javax.script.ScriptException
java.lang.NoSuchMethodException
-
getInterface
public <T> T getInterface(java.lang.Class<T> clazz)
- Specified by:
getInterface
in interfacejavax.script.Invocable
-
getInterface
public <T> T getInterface(java.lang.Object thiz, java.lang.Class<T> clazz)
- Specified by:
getInterface
in interfacejavax.script.Invocable
-
setClassLoader
public void setClassLoader(GroovyClassLoader classLoader)
-
getClassLoader
public GroovyClassLoader getClassLoader()
-
-