AutoCloseable
public final class RubyInterpreter
extends be.yildizgames.module.script.ScriptInterpreter
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
static RubyInterpreter |
concurrent() |
+------------------+ +------------------+ +------------------+
| Variable Map | | Variable Map | | Variable Map |
+------------------+ +------------------+ +------------------+
+------------------------------------------------------------+
| Ruby runtime |
+------------------------------------------------------------+
+------------------------------------------------------------+
| ScriptingContainer |
+------------------------------------------------------------+
+------------------+ +------------------+ +------------------+
| Java Thread | | Java Thread | | Java Thread |
+------------------+ +------------------+ +------------------+
+------------------------------------------------------------+
| JVM |
+------------------------------------------------------------+
|
Object |
getClassMethods(Class<?> classToGet) |
|
String |
getFileExtension() |
|
String |
getFileHeader() |
|
void |
initialize() |
Initialize the ruby engine.
|
boolean |
isClosed() |
|
void |
print(String toPrint) |
|
void |
registerClass(Class clazz) |
Register a class to be recognized by Ruby.
|
Object |
runCommand(String command) |
|
be.yildizgames.module.script.ParsedScript |
runScript(String file) |
|
void |
setOutput(Writer output) |
|
static RubyInterpreter |
singleThread() |
+------------------+ +------------------+ +------------------+
| Variable Map | | Variable Map | | Variable Map |
+------------------+ +------------------+ +------------------+
+------------------+ +------------------+ +------------------+
| Ruby runtime | | Ruby runtime | | Ruby runtime |
+------------------+ +------------------+ +------------------+
+------------------+ +------------------+ +------------------+
|ScriptingContainer| |ScriptingContainer| |ScriptingContainer|
+------------------+ +------------------+ +------------------+
+------------------------------------------------------------+
| JVM |
+------------------------------------------------------------+
|
static RubyInterpreter |
singleton() |
+------------------------------------------------------------+
| Variable Map |
+------------------------------------------------------------+
+------------------------------------------------------------+
| Ruby runtime |
+------------------------------------------------------------+
+------------------+ +------------------+ +------------------+
|ScriptingContainer| |ScriptingContainer| |ScriptingContainer|
+------------------+ +------------------+ +------------------+
+------------------------------------------------------------+
| JVM |
+------------------------------------------------------------+
|
static RubyInterpreter |
threadSafe() |
+------------------+ +------------------+ +------------------+
| Variable Map | | Variable Map | | Variable Map |
+------------------+ +------------------+ +------------------+
+------------------+ +------------------+ +------------------+
| Ruby runtime | | Ruby runtime | | Ruby runtime |
+------------------+ +------------------+ +------------------+
+------------------------------------------------------------+
| ScriptingContainer |
+------------------------------------------------------------+
+------------------+ +------------------+ +------------------+
| Java Thread | | Java Thread | | Java Thread |
+------------------+ +------------------+ +------------------+
+------------------------------------------------------------+
| JVM |
+------------------------------------------------------------+
|
public static RubyInterpreter singleThread()
public static RubyInterpreter concurrent()
public static RubyInterpreter singleton()
public static RubyInterpreter threadSafe()
public void initialize() throws be.yildizgames.module.script.ScriptException
be.yildizgames.module.script.ScriptException
- If the initialization failed.public void registerClass(Class clazz) throws be.yildizgames.module.script.ScriptException
clazz
- Class to register.be.yildizgames.module.script.ScriptException
- If the class cannot be registered.public void setOutput(Writer output)
setOutput
in class be.yildizgames.module.script.ScriptInterpreter
public be.yildizgames.module.script.ParsedScript runScript(String file) throws be.yildizgames.module.script.ScriptException
runScript
in class be.yildizgames.module.script.ScriptInterpreter
be.yildizgames.module.script.ScriptException
public Object runCommand(String command) throws be.yildizgames.module.script.ScriptException
runCommand
in class be.yildizgames.module.script.ScriptInterpreter
be.yildizgames.module.script.ScriptException
public Object getClassMethods(Class<?> classToGet)
getClassMethods
in class be.yildizgames.module.script.ScriptInterpreter
public void print(String toPrint)
print
in class be.yildizgames.module.script.ScriptInterpreter
public String getFileHeader()
getFileHeader
in class be.yildizgames.module.script.ScriptInterpreter
public String getFileExtension()
getFileExtension
in class be.yildizgames.module.script.ScriptInterpreter
public boolean isClosed()
isClosed
in class be.yildizgames.module.script.ScriptInterpreter
public void close()
Copyright © 2014–2018. All rights reserved.