Package io.reactiverse.es4x
Class Runtime
- java.lang.Object
-
- io.reactiverse.es4x.impl.EventEmitterImpl
-
- io.reactiverse.es4x.Runtime
-
- All Implemented Interfaces:
EventEmitter
public final class Runtime extends EventEmitterImpl
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()close the current runtime and shutdown all the engine related resources.voidconfig(io.vertx.core.json.JsonObject config)passes the given configuration to the runtime.org.graalvm.polyglot.Valueeval(String script)Evals a given sript string.org.graalvm.polyglot.Valueeval(String script, boolean interactive)Evals a given script string.org.graalvm.polyglot.Valueeval(String script, String name, boolean literal)Evals a given sript string.org.graalvm.polyglot.Valueeval(String script, String name, String contentType, boolean interactive)Evals a given script string.org.graalvm.polyglot.Valueeval(org.graalvm.polyglot.Source source)Evals a given script string.org.graalvm.polyglot.Valueget(String name)Gets a value from the global scope.org.graalvm.polyglot.Valueparse(String script, boolean interactive)Parse a given script string.org.graalvm.polyglot.Valueparse(String script, String contentType, boolean interactive)Parse a given script string.voidput(String name, Object value)Puts a value to the global scope.-
Methods inherited from class io.reactiverse.es4x.impl.EventEmitterImpl
emit, on
-
-
-
-
Method Detail
-
config
public void config(io.vertx.core.json.JsonObject config)
passes the given configuration to the runtime.- Parameters:
config- given configuration.
-
eval
public org.graalvm.polyglot.Value eval(String script, String name, String contentType, boolean interactive)
Evals a given script string.- Parameters:
script- string containing code.name- string containing name of the script (e.g.: the filename).contentType- the script content typeinteractive- literals are non listed on debug sessions- Returns:
- returns the evaluation result.
-
eval
public org.graalvm.polyglot.Value eval(org.graalvm.polyglot.Source source)
Evals a given script string.- Parameters:
source- source containing code.- Returns:
- returns the evaluation result.
-
put
public void put(String name, Object value)
Puts a value to the global scope.- Parameters:
name- the key to identify the value in the global scopevalue- the value to store.
-
get
public org.graalvm.polyglot.Value get(String name)
Gets a value from the global scope.- Parameters:
name- the key to identify the value in the global scope- Returns:
- the value
-
close
public void close()
close the current runtime and shutdown all the engine related resources.
-
eval
public org.graalvm.polyglot.Value eval(String script, boolean interactive)
Evals a given script string.- Parameters:
script- string containing code.interactive- literals are non listed on debug sessions- Returns:
- returns the evaluation result.
-
parse
public org.graalvm.polyglot.Value parse(String script, boolean interactive)
Parse a given script string.- Parameters:
script- string containing code.interactive- literals are non listed on debug sessions- Returns:
- returns the parsing result.
-
parse
public org.graalvm.polyglot.Value parse(String script, String contentType, boolean interactive)
Parse a given script string.- Parameters:
script- string containing code.contentType- the script content typeinteractive- literals are non listed on debug sessions- Returns:
- returns the parsing result.
-
eval
public org.graalvm.polyglot.Value eval(String script, String name, boolean literal)
Evals a given sript string.- Parameters:
script- string containing code.name- string containing name of the script (e.g.: the filename).literal- literals are non listed on debug sessions- Returns:
- returns the evaluation result.
-
eval
public org.graalvm.polyglot.Value eval(String script)
Evals a given sript string.- Parameters:
script- string containing code.- Returns:
- returns the evaluation result.
-
-