[Java] Class GroovyScriptEngineImpl
- org.codehaus.groovy.jsr223.GroovyScriptEngineImpl
- All Implemented Interfaces and Traits:
- Compilable, Invocable
public class GroovyScriptEngineImpl extends AbstractScriptEngine
JSR-223 Engine implementation.
- Authors:
- Adapted from original by Mike Grogan
- Adapted from original by A. Sundararajan
- Jim White
- Guillaume Laforge
- Jochen Theodorou
Fields inherited from class | Fields |
---|---|
class AbstractScriptEngine | ARGV, FILENAME, ENGINE, ENGINE_VERSION, NAME, LANGUAGE, LANGUAGE_VERSION |
Constructor Summary
Constructor and description |
---|
GroovyScriptEngineImpl
() |
GroovyScriptEngineImpl
(GroovyClassLoader classLoader) |
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
CompiledScript |
compile(String scriptSource) | |
CompiledScript |
compile(Reader reader) | |
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) |
Inherited Methods Summary
Methods inherited from class | Name |
---|---|
class AbstractScriptEngine | get, put, getContext, setBindings, setContext, getBindings, eval, eval, eval, eval, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll, getFactory, createBindings, eval, eval |
class Object | wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Constructor Detail
public GroovyScriptEngineImpl()
public GroovyScriptEngineImpl(GroovyClassLoader classLoader)
Method Detail
public CompiledScript compile(String scriptSource)
public CompiledScript compile(Reader reader)
public Bindings createBindings()
public Object eval(Reader reader, ScriptContext ctx)
public Object eval(String script, ScriptContext ctx)
public GroovyClassLoader getClassLoader()
public ScriptEngineFactory getFactory()
<T> public T getInterface(Class<T> clazz)
<T> public T getInterface(Object thiz, Class<T> clazz)
public Object invokeFunction(String name, Object... args)
public Object invokeMethod(Object thiz, String name, Object... args)
public void setClassLoader(GroovyClassLoader classLoader)
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/2.4.21/html/gapi/org/codehaus/groovy/jsr223/GroovyScriptEngineImpl.html