public class DefaultScriptInterpreter extends Object implements ScriptInterpreter
ScriptInterpreter.| Constructor and Description |
|---|
DefaultScriptInterpreter(PrefService prefs,
ScriptService scriptService,
ScriptLanguage language)
Constructs a new
DefaultScriptInterpreter. |
| Modifier and Type | Method and Description |
|---|---|
void |
eval(String command)
Evaluates a command.
|
ScriptEngine |
getEngine()
Returns the associated
ScriptEngine. |
ScriptLanguage |
getLanguage()
Returns the associated
ScriptLanguage. |
void |
readHistory()
Reads the persisted history of the current script interpreter.
|
String |
walkHistory(String currentCommand,
boolean forward)
Obtains the next/previous command in the command history.
|
void |
writeHistory()
Persists the history of the current script interpreter.
|
public DefaultScriptInterpreter(PrefService prefs, ScriptService scriptService, ScriptLanguage language)
DefaultScriptInterpreter.scriptService - the script servicelanguage - the script languagepublic void readHistory()
ScriptInterpreterreadHistory in interface ScriptInterpreterpublic void writeHistory()
ScriptInterpreterwriteHistory in interface ScriptInterpreterpublic String walkHistory(String currentCommand, boolean forward)
ScriptInterpreterwalkHistory in interface ScriptInterpretercurrentCommand - the current command (will be stored in the history)forward - if true, the next history entry is returned (more recent),
if false, the previous onepublic void eval(String command) throws ScriptException
ScriptInterpretereval in interface ScriptInterpretercommand - the command to evaluateScriptExceptionpublic ScriptLanguage getLanguage()
ScriptInterpreterScriptLanguage.getLanguage in interface ScriptInterpreterpublic ScriptEngine getEngine()
ScriptInterpreterScriptEngine.getEngine in interface ScriptInterpreterCopyright © 2009–2015 SciJava. All rights reserved.