public interface ScriptRunner extends JsonBuilderFactory
| Modifier and Type | Method and Description |
|---|---|
<T> T |
callMethod(Object obj,
String name,
Class<T> resultType,
Object... args)
Calls an object's method
|
void |
callMethod(Object obj,
String name,
Object... args)
Calls an object's method
|
<T> T |
callMethod(String name,
Class<T> resultType,
Object... args)
Calls a top-level method
|
void |
callMethod(String name,
Object... args)
Calls a top-level method
|
<T> T |
convert(Object o,
Class<T> type)
Tries to convert the given object to the given type
|
void |
eval(Reader reader)
Executes a script provided by a given reader
|
String |
getName() |
String |
getVersion() |
void |
loadScript(URL url)
Loads a script from a URL and evaluates it
|
createJsonBuilderString getName()
String getVersion()
void loadScript(URL url) throws IOException, ScriptRunnerException
url - the script's URLIOException - if the script could not be loadedScriptRunnerException - if the script is invalidvoid eval(Reader reader) throws ScriptRunnerException, IOException
reader - the readerScriptRunnerException - if the script could not be executedIOException - if the script could not be read from the reader<T> T callMethod(String name, Class<T> resultType, Object... args) throws ScriptRunnerException
T - the type of the return valuename - the method's nameresultType - the expected type of the return valueargs - the argumentsScriptRunnerException - if the method could not be calledvoid callMethod(String name, Object... args) throws ScriptRunnerException
name - the method's nameargs - the argumentsScriptRunnerException - if the method could not be called<T> T callMethod(Object obj, String name, Class<T> resultType, Object... args) throws ScriptRunnerException
T - the type of the return valueobj - the objectname - the method's nameresultType - the expected type of the return valueargs - the argumentsScriptRunnerException - if the method could not be calledvoid callMethod(Object obj, String name, Object... args) throws ScriptRunnerException
obj - the objectname - the method's nameargs - the argumentsScriptRunnerException - if the method could not be called