public interface Interpreter extends AutoCloseable, Serializable
| Modifier and Type | Method and Description |
|---|---|
void |
exec(String code)
Execute an arbitrary number of statements in this interpreter.
|
Object |
get(String name)
Retrieves the value to the specified name from the interpreter.
|
<T> T |
get(String name,
Class<T> tClass)
Retrieves the value to the specified name from the interpreter.
|
Object |
invoke(String name,
Map<String,Object> kwargs)
Invokes a callable function with a named arguments given by the dictionary kwargs.
|
Object |
invoke(String name,
Object... args)
Invokes a callable function with a variable number of arguments args.
|
Object |
invoke(String name,
Object[] args,
Map<String,Object> kwargs)
Invokes a callable function with a variable number of arguments args and a named arguments
given by the dictionary kwargs.
|
Object |
invokeMethod(String obj,
String method,
Object... args)
Invokes the method of a called object with a variable number of arguments args.
|
void |
set(String name,
Object value)
Sets the Java Object into the interpreter's global scope with the specified variable name.
|
closevoid set(String name, Object value)
name - the variable namevalue - the variable valueObject get(String name)
name - the variable name<T> T get(String name, Class<T> tClass)
name - the variable nametClass - the corresponding Java Class of the value.Object invoke(String name, Object... args)
name - the function nameargs - the variable number of argumentsObject invoke(String name, Map<String,Object> kwargs)
name - the function namekwargs - the named argumentsObject invoke(String name, Object[] args, Map<String,Object> kwargs)
name - the function nameargs - the variable number of argumentskwargs - the named argumentsObject invokeMethod(String obj, String method, Object... args)
obj - the called objectmethod - the name of the methodargs - the variable number of argumentsvoid exec(String code)
Copyright © 2022–2025. All rights reserved.