public interface ScriptEngine
| Modifier and Type | Method and Description |
|---|---|
void |
del(String... vars)
Deletes variables.
|
default Object |
deserialize(String value)
Deserialize value
|
Object |
deserialize(String value,
String format)
Deserialize value
|
default Object |
execute(File script)
Executes scriptEngine script
|
Object |
execute(File script,
Object[] args)
Executes scriptEngine script
|
Object |
execute(Object closure,
Object... args)
Executes scriptEngine closure
|
Object |
execute(String statement)
Executes scriptEngine statement
|
default Map<String,Object> |
find()
Gets all variables with values
|
Map<String,Object> |
find(String name)
Gets all the variables that match the name.
|
Object |
get(String name)
Gets variable value
|
List<String> |
getDeserializationFormats() |
String |
getEngineName() |
Collection<String> |
getExtensions() |
org.jline.reader.Completer |
getScriptCompleter() |
List<String> |
getSerializationFormats() |
boolean |
hasVariable(String name)
Tests if console variable exists
|
void |
persist(Path file,
Object object)
Persists object value to file.
|
void |
persist(Path file,
Object object,
String format)
Persists object value to file.
|
void |
put(String name,
Object value)
Creates variable
|
String |
toJson(Object object)
Serialize object to JSON string.
|
Map<String,Object> |
toMap(Object object)
Converts object fields to map.
|
String |
toString(Object object)
Converts object to string.
|
String getEngineName()
Collection<String> getExtensions()
org.jline.reader.Completer getScriptCompleter()
boolean hasVariable(String name)
name - variable namevoid put(String name, Object value)
name - variable namevalue - valueObject get(String name)
name - variable nameMap<String,Object> find(String name)
name - variable namevoid del(String... vars)
vars - variables to be deletedString toJson(Object object)
object - object to serialize to JSONString toString(Object object)
object - the objectMap<String,Object> toMap(Object object)
object - the objectdefault Object deserialize(String value)
value - the valueObject deserialize(String value, String format)
value - the valueformat - serialization formatList<String> getSerializationFormats()
List<String> getDeserializationFormats()
void persist(Path file, Object object)
file - fileobject - objectvoid persist(Path file, Object object, String format)
file - the fileobject - the objectformat - serialization formatObject execute(String statement) throws Exception
statement - the statementException - in case of errordefault Object execute(File script) throws Exception
script - the scriptException - in case of errorObject execute(File script, Object[] args) throws Exception
script - the scriptargs - argumentsException - in case of errorCopyright © 2020. All rights reserved.