Package org.jruby.embed.jsr223
Class JRubyEngine
java.lang.Object
org.jruby.embed.jsr223.JRubyEngine
- All Implemented Interfaces:
AutoCloseable
,Compilable
,Invocable
,ScriptEngine
public class JRubyEngine
extends Object
implements AutoCloseable, Compilable, Invocable, ScriptEngine
Implementation of javax.script.ScriptEngine/Compilable/Invocable.
- Author:
- Yoko Harada <[email protected]>
-
Field Summary
Fields inherited from interface javax.script.ScriptEngine
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
eval
(Reader reader, ScriptContext context) eval
(String script, ScriptContext context) getBindings
(int scope) <T> T
getInterface
(Class<T> returnType) <T> T
getInterface
(Object receiver, Class<T> returnType) protected ScriptContext
getScriptContext
(Bindings bindings) invokeFunction
(String method, Object... args) invokeMethod
(Object receiver, String method, Object... args) void
void
setBindings
(Bindings bindings, int scope) void
setContext
(ScriptContext context)
-
Method Details
-
compile
- Specified by:
compile
in interfaceCompilable
- Throws:
ScriptException
-
compile
- Specified by:
compile
in interfaceCompilable
- Throws:
ScriptException
-
eval
- Specified by:
eval
in interfaceScriptEngine
- Throws:
ScriptException
-
eval
- Specified by:
eval
in interfaceScriptEngine
- Throws:
ScriptException
-
eval
- Specified by:
eval
in interfaceScriptEngine
- Throws:
ScriptException
-
eval
- Specified by:
eval
in interfaceScriptEngine
- Throws:
ScriptException
-
eval
- Specified by:
eval
in interfaceScriptEngine
- Throws:
ScriptException
-
eval
- Specified by:
eval
in interfaceScriptEngine
- Throws:
ScriptException
-
getScriptContext
-
get
- Specified by:
get
in interfaceScriptEngine
-
put
- Specified by:
put
in interfaceScriptEngine
-
getBindings
- Specified by:
getBindings
in interfaceScriptEngine
-
setBindings
- Specified by:
setBindings
in interfaceScriptEngine
-
createBindings
- Specified by:
createBindings
in interfaceScriptEngine
-
getContext
- Specified by:
getContext
in interfaceScriptEngine
-
setContext
- Specified by:
setContext
in interfaceScriptEngine
-
getFactory
- Specified by:
getFactory
in interfaceScriptEngine
-
invokeMethod
public Object invokeMethod(Object receiver, String method, Object... args) throws ScriptException, NoSuchMethodException - Specified by:
invokeMethod
in interfaceInvocable
- Throws:
ScriptException
NoSuchMethodException
-
invokeFunction
public Object invokeFunction(String method, Object... args) throws ScriptException, NoSuchMethodException - Specified by:
invokeFunction
in interfaceInvocable
- Throws:
ScriptException
NoSuchMethodException
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getInterface
- Specified by:
getInterface
in interfaceInvocable
-
getInterface
- Specified by:
getInterface
in interfaceInvocable
-