|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--comshell.CommandInterface
Handles universal commands and basic maintenance for the command shell
Field Summary | |
java.util.HashMap |
bindings
|
Command |
command
|
java.io.InputStream |
is
Local data members |
java.util.LinkedList |
is_stack
|
static int |
MAX_INPUT
Static constant members |
java.io.PrintStream |
os
|
Constructor Summary | |
CommandInterface(java.io.InputStream is,
java.io.PrintStream os)
Constructor |
Method Summary | |
void |
exec_return()
Handles the 'return' command (to return execution to the calling script (if any). |
void |
exec(java.lang.String filename)
Handles the 'exec' command |
java.lang.String |
getBindings(java.lang.String varname)
Gets an environmental variable binding (local to this shell only) |
void |
getCommand()
Parses a command from the current input stream and determines if it is locally executable. |
void |
initEnvVarsFromFile(java.lang.String filename)
Initializes the environmental variable bindings from a file |
boolean |
isStreamStackEmpty()
Are we at the top level of the execution stack? (When exec is called, the newly exec'ed input stream is pushed onto the execution stack. |
void |
listEnv()
Handles the 'listenv' command |
java.io.InputStream |
popStream()
Pops the current command stream from the execution stack |
void |
printHelp()
Handles the 'help' command - prints the command menu |
void |
pushStream(java.io.InputStream is)
Pushes a new command stream onto the execution stack |
void |
setBindings(java.lang.String varname,
java.lang.String value)
Registers a new environmental variable binding (local to this shell only) |
void |
setEnv()
Handles the 'setenv' command |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MAX_INPUT
public java.io.InputStream is
public java.io.PrintStream os
public java.util.HashMap bindings
public Command command
public java.util.LinkedList is_stack
Constructor Detail |
public CommandInterface(java.io.InputStream is, java.io.PrintStream os)
is
- InputStream for shell inputos
- OutputStream for shell outputMethod Detail |
public boolean isStreamStackEmpty()
public void pushStream(java.io.InputStream is)
is
- Command stream to pushpublic java.io.InputStream popStream()
public void setBindings(java.lang.String varname, java.lang.String value)
varname
- Environmental variable namevalue
- Environmental variable bindingpublic java.lang.String getBindings(java.lang.String varname)
varname
- The binding to retrievepublic void initEnvVarsFromFile(java.lang.String filename)
filename
- File name to load env var bindings frompublic void listEnv()
public void setEnv()
public void exec(java.lang.String filename)
filename
- File to executepublic void exec_return()
public void printHelp()
public void getCommand() throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |