public class EnvironmentModule extends AbstractEnvironment
Modifier and Type | Field and Description |
---|---|
static String |
MODULE_NAME |
static String |
MODULE_PREFIX |
Constructor and Description |
---|
EnvironmentModule() |
Modifier and Type | Method and Description |
---|---|
Object |
execute(Object data)
Execute script code.
|
void |
exit(Object value)
Terminates script execution immediately.
|
IScriptEngine |
getScriptEngine()
Get the current script engine instance.
|
static String |
getWrappedVariableName(Object toBeWrapped) |
void |
help(String topic)
Open help page on addressed topic.
|
Object |
include(String filename)
Include and execute a script file.
|
boolean |
loadJar(Object location)
Add a jar file to the classpath.
|
void |
wrap(Object toBeWrapped)
Creates wrapper functions for a given java instance.
|
addModuleListener, getEnvironment, getModule, getModule, getModules, initialize, listModules, loadModule, print, printError, readInput, removeModuleListener
public static final String MODULE_NAME
public static final String MODULE_PREFIX
public void wrap(Object toBeWrapped)
WrapToScript
and creates wrapping code in
the target script language. A method named <instance>.myMethod() will be made available by calling myMethod().toBeWrapped
- instance to be wrappedpublic final Object execute(Object data)
data
- code to be interpretedpublic final void exit(@ScriptParameter(defaultValue="org.eclipse.ease.modules.ScriptParameter.null") Object value)
value
- return codepublic final Object include(String filename)
filename
- name of file to be includedThrowable
public IScriptEngine getScriptEngine()
getScriptEngine
in interface IEnvironment
getScriptEngine
in class AbstractScriptModule
IScriptEngine
instancepublic boolean loadJar(Object location) throws MalformedURLException
location
- URL
, Path
, File
or IFile
true
when input could be converted to a URLMalformedURLException
- invalid URL detectedpublic void help(@ScriptParameter(defaultValue="org.eclipse.ease.modules.ScriptParameter.null") String topic)
topic
- help topic to open (typically a function name)