public abstract class Command extends java.lang.Object
Command is an action that can alter the state of an
Interpreter.| Modifier and Type | Field and Description |
|---|---|
protected Console |
console
Console that created this command.
|
| Constructor and Description |
|---|
Command(Console console)
Creates a command.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
execute(Interpreter interpreter)
Hook to provide various implementations of command execution.
|
protected java.io.InputStream |
getInputStream(java.lang.String path)
Creates a
InputStream using path. |
public abstract void execute(Interpreter interpreter) throws java.lang.Exception
interpreter - Jython interpreter that will execute the command.java.lang.Exception - An error was encountered executing the command. Jython
will catch three standard Python exceptions: SyntaxError, ValueError,
and OverflowError. Other exceptions are thrown.protected java.io.InputStream getInputStream(java.lang.String path) throws java.lang.Exception
InputStream using path. It's here entirely for
convenience.path - Path to the desired file.path.java.lang.Exception - if there was badness.