public class JRubyEngine extends Object implements Compilable, Invocable, ScriptEngine
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME
Modifier and Type | Method and Description |
---|---|
CompiledScript |
compile(Reader reader) |
CompiledScript |
compile(String script) |
Bindings |
createBindings() |
Object |
eval(Reader reader) |
Object |
eval(Reader reader,
Bindings bindings) |
Object |
eval(Reader reader,
ScriptContext context) |
Object |
eval(String script) |
Object |
eval(String script,
Bindings bindings) |
Object |
eval(String script,
ScriptContext context) |
Object |
get(String key) |
Bindings |
getBindings(int scope) |
ScriptContext |
getContext() |
ScriptEngineFactory |
getFactory() |
<T> T |
getInterface(Class<T> returnType) |
<T> T |
getInterface(Object receiver,
Class<T> returnType) |
protected ScriptContext |
getScriptContext(Bindings bindings) |
Object |
invokeFunction(String method,
Object... args) |
Object |
invokeMethod(Object receiver,
String method,
Object... args) |
void |
put(String key,
Object value) |
void |
setBindings(Bindings bindings,
int scope) |
void |
setContext(ScriptContext ctx) |
public CompiledScript compile(String script) throws ScriptException
compile
in interface Compilable
ScriptException
public CompiledScript compile(Reader reader) throws ScriptException
compile
in interface Compilable
ScriptException
public Object eval(String script, ScriptContext context) throws ScriptException
eval
in interface ScriptEngine
ScriptException
public Object eval(Reader reader, ScriptContext context) throws ScriptException
eval
in interface ScriptEngine
ScriptException
public Object eval(String script, Bindings bindings) throws ScriptException
eval
in interface ScriptEngine
ScriptException
public Object eval(Reader reader, Bindings bindings) throws ScriptException
eval
in interface ScriptEngine
ScriptException
public Object eval(String script) throws ScriptException
eval
in interface ScriptEngine
ScriptException
public Object eval(Reader reader) throws ScriptException
eval
in interface ScriptEngine
ScriptException
protected ScriptContext getScriptContext(Bindings bindings)
public Object get(String key)
get
in interface ScriptEngine
public void put(String key, Object value)
put
in interface ScriptEngine
public Bindings getBindings(int scope)
getBindings
in interface ScriptEngine
public void setBindings(Bindings bindings, int scope)
setBindings
in interface ScriptEngine
public Bindings createBindings()
createBindings
in interface ScriptEngine
public ScriptContext getContext()
getContext
in interface ScriptEngine
public void setContext(ScriptContext ctx)
setContext
in interface ScriptEngine
public ScriptEngineFactory getFactory()
getFactory
in interface ScriptEngine
public Object invokeMethod(Object receiver, String method, Object... args) throws ScriptException, NoSuchMethodException
invokeMethod
in interface Invocable
ScriptException
NoSuchMethodException
public Object invokeFunction(String method, Object... args) throws ScriptException, NoSuchMethodException
invokeFunction
in interface Invocable
ScriptException
NoSuchMethodException
public <T> T getInterface(Class<T> returnType)
getInterface
in interface Invocable
public <T> T getInterface(Object receiver, Class<T> returnType)
getInterface
in interface Invocable
Copyright © 2001-2016 JRuby. All Rights Reserved.