public class ConsoleShell extends java.lang.Object implements Shell, ConnectionListener
| Constructor and Description |
|---|
ConsoleShell()
Create a console shell attached to the system terminal.
|
ConsoleShell(Connector connector)
Create a console shell attached to a specified connector.
|
ConsoleShell(Connector connector,
java.nio.file.Path historyFile)
Create a console shell attached to a specified connector.
|
ConsoleShell(java.io.InputStream in,
java.io.OutputStream out)
Create a console shell attached to a specified input and output stream.
|
ConsoleShell(java.io.InputStream in,
java.io.OutputStream out,
java.nio.file.Path historyFile)
Create a console shell attached to a specified input and output stream.
|
ConsoleShell(java.nio.file.Path historyFile)
Create a console shell attached to the system terminal.
|
| Modifier and Type | Method and Description |
|---|---|
void |
connected(Connector connector) |
void |
error(java.lang.Object obj)
Display error.
|
void |
init(ScriptEngine engine)
Initialize the shell.
|
void |
input(java.lang.Object obj)
Display input line.
|
boolean |
isDumb()
Check if terminal supports ANSI control sequences.
|
void |
notify(java.lang.Object obj)
Display unsolicited notification.
|
void |
println(java.lang.Object obj)
Display script output.
|
void |
prompt(java.lang.Object obj)
Prompt user for input.
|
java.lang.String |
readLine(java.lang.String prompt1,
java.lang.String prompt2,
java.lang.String line)
Read a line from the shell.
|
void |
shutdown()
Shutdown the shell.
|
java.lang.String |
toString() |
public ConsoleShell()
public ConsoleShell(java.io.InputStream in,
java.io.OutputStream out)
in - input stream.out - output stream.public ConsoleShell(Connector connector)
connector - input/output streams.public ConsoleShell(java.nio.file.Path historyFile)
historyFile - file to store command history.public ConsoleShell(java.io.InputStream in,
java.io.OutputStream out,
java.nio.file.Path historyFile)
in - input stream.out - output stream.historyFile - file to store command history.public ConsoleShell(Connector connector, java.nio.file.Path historyFile)
connector - input/output streams.historyFile - file to store command history.public void connected(Connector connector)
connected in interface ConnectionListenerpublic void init(ScriptEngine engine)
Shellpublic void prompt(java.lang.Object obj)
Shellpublic void input(java.lang.Object obj)
Shellpublic void println(java.lang.Object obj)
Shellpublic void notify(java.lang.Object obj)
Shellpublic void error(java.lang.Object obj)
Shellpublic java.lang.String readLine(java.lang.String prompt1,
java.lang.String prompt2,
java.lang.String line)
Shellpublic boolean isDumb()
Shellpublic void shutdown()
Shellpublic java.lang.String toString()
toString in class java.lang.Object