public class ScriptWrapper extends Object
Modifier | Constructor and Description |
---|---|
|
ScriptWrapper() |
|
ScriptWrapper(String name,
String description,
ScriptEngineWrapper engine,
ScriptType type) |
|
ScriptWrapper(String name,
String description,
ScriptEngineWrapper engine,
ScriptType type,
boolean enabled,
File file) |
|
ScriptWrapper(String name,
String description,
String engineName,
ScriptType type,
boolean enabled,
File file) |
protected |
ScriptWrapper(String name,
String description,
String engineName,
String typeName,
boolean enabled,
File file) |
Modifier and Type | Method and Description |
---|---|
String |
getContents() |
String |
getDescription() |
ScriptEngineWrapper |
getEngine()
Gets the script engine wrapper.
|
String |
getEngineName() |
File |
getFile() |
<T> T |
getInterface(Class<T> class1) |
String |
getLastErrorDetails() |
Exception |
getLastException() |
String |
getLastOutput() |
String |
getName() |
ScriptType |
getType() |
String |
getTypeName() |
Writer |
getWriter()
Gets the writer which will be written to every time this script runs (if any)
|
boolean |
hasChangedOnDisk()
Returns true if the script has changed on disk since it was loaded into this class
|
boolean |
isChanged() |
boolean |
isEnabled() |
boolean |
isError() |
boolean |
isLoadOnStart() |
boolean |
isRunableStandalone() |
void |
reloadScript()
Reloads the script.
|
void |
setChanged(boolean changed) |
void |
setContents(String contents) |
void |
setDescription(String description) |
void |
setEnabled(boolean enabled)
Sets if this script is enabled.
|
void |
setEngine(ScriptEngineWrapper engine) |
void |
setEngineName(String engineName) |
void |
setError(boolean error) |
void |
setFile(File file) |
void |
setLastErrorDetails(String lastErrorDetails) |
void |
setLastException(Exception lastException) |
void |
setLastOutput(String lastOutput) |
void |
setLoadOnStart(boolean loadOnStart) |
void |
setName(String name) |
void |
setType(ScriptType type) |
void |
setWriter(Writer writer)
Set a writer which will be written to every time this script runs
|
public ScriptWrapper()
public ScriptWrapper(String name, String description, ScriptEngineWrapper engine, ScriptType type)
public ScriptWrapper(String name, String description, String engineName, ScriptType type, boolean enabled, File file)
public ScriptWrapper(String name, String description, ScriptEngineWrapper engine, ScriptType type, boolean enabled, File file)
public String getName()
public void setName(String name)
public String getDescription()
public void setDescription(String description)
public ScriptEngineWrapper getEngine()
null
if the engine is not installed or was
not yet set.null
if not installed or was not yet setpublic void setEngine(ScriptEngineWrapper engine)
public void setEngineName(String engineName)
public String getEngineName()
public ScriptType getType()
public void setType(ScriptType type)
public String getTypeName()
public String getContents()
public void setContents(String contents)
public String getLastOutput()
public void setLastOutput(String lastOutput)
public boolean isChanged()
public void setChanged(boolean changed)
public boolean isEnabled()
public void setEnabled(boolean enabled)
It's not possible to enable scripts without engine.
enabled
- true
if the script should be enabled, false
otherwisegetEngine()
public String getLastErrorDetails()
public void setLastErrorDetails(String lastErrorDetails)
public Exception getLastException()
public void setLastException(Exception lastException)
public boolean isError()
public void setError(boolean error)
public boolean isLoadOnStart()
public void setLoadOnStart(boolean loadOnStart)
public File getFile()
public void setFile(File file)
public <T> T getInterface(Class<T> class1) throws ScriptException, IOException
ScriptException
IOException
public boolean isRunableStandalone()
public Writer getWriter()
public void setWriter(Writer writer)
writer
- public void reloadScript() throws IOException
loadScript(Charset)
IOException
public boolean hasChangedOnDisk()