public final class CommandRunner extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CHARSET_NAME |
| Constructor and Description |
|---|
CommandRunner(OutputStream outputStream,
InputStream inputStream)
Create new object.
|
CommandRunner(OutputStream outputStream,
InputStream inputStream,
Charset charset)
Create new object.
|
CommandRunner(OutputStream outputStream,
InputStream inputStream,
OutputStream logOutputStream)
Create new object.
|
CommandRunner(OutputStream outputStream,
InputStream inputStream,
OutputStream logOutputStream,
Charset charset)
Create new object.
|
CommandRunner(OutputStream outputStream,
InputStream inputStream,
OutputStream logOutputStream,
String charsetName)
Create new object.
|
CommandRunner(OutputStream outputStream,
InputStream inputStream,
String charsetName)
Create new object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Command command)
Execute the command sequence with the default context, started from the specified command.
|
void |
execute(Command command,
Context context)
Execute the command sequence with the specified context, started from the specified command.
|
BufferedReader |
getReader()
Get the stream to read the user input.
|
PrintWriter |
getWriter()
Get the stream to write the command output.
|
public static final String CHARSET_NAME
public CommandRunner(OutputStream outputStream, InputStream inputStream)
outputStream - the stream to write the command output.inputStream - the stream to read the user input.public CommandRunner(OutputStream outputStream, InputStream inputStream, OutputStream logOutputStream)
outputStream - the stream to write the command output.inputStream - the stream to read the user input.logOutputStream - the stream to log the user input and the command output.public CommandRunner(OutputStream outputStream, InputStream inputStream, String charsetName)
outputStream - the stream to write the command output.inputStream - the stream to read the user input.charsetName - the name of the charset.public CommandRunner(OutputStream outputStream, InputStream inputStream, OutputStream logOutputStream, String charsetName)
outputStream - the stream to write the command output.inputStream - the stream to read the user input.logOutputStream - the stream to log the user input and the command output.charsetName - the name of the charset.public CommandRunner(OutputStream outputStream, InputStream inputStream, Charset charset)
outputStream - the stream to write the command output.inputStream - the stream to read the user input.charset - the charset.public CommandRunner(OutputStream outputStream, InputStream inputStream, OutputStream logOutputStream, Charset charset)
outputStream - the stream to write the command output.inputStream - the stream to read the user input.logOutputStream - the stream to log the user input and the command output.charset - the charset.public PrintWriter getWriter()
public BufferedReader getReader()
public void execute(Command command)
command - the specified command to start with.Copyright © 2019. All rights reserved.