public class CLICommandConsole
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CLICommandConsole.CLIBuiltinCommand
Super class of CLI command manager built-in commands
|
static class |
CLICommandConsole.CLIHelpCommand |
static class |
CLICommandConsole.CLISourceCommand |
Constructor and Description |
---|
CLICommandConsole(CommandManager commandManager)
Create CLICommandConsole to start console prompt.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(java.lang.String line)
Execute a commands in the raw line.
|
void |
execute(java.lang.String[] args)
Execute a commands in the string array.
|
void |
executeMany(java.lang.String line)
Execute commands in the raw line.
|
void |
executeMany(java.lang.String[] args)
Execute commands in the parsed arguments.
|
CommandManager |
getCommandManager() |
ManagedCommand |
getConfiguredCommandInstance(java.lang.String line)
Get a configured commands in the raw line.
|
ManagedCommand |
getConfiguredCommandInstance(java.lang.String[] args)
Get a configured commands with a string array.
|
void |
loadScript(java.io.Reader reader)
Load a script from a reader and execute.
|
void |
startConsole()
Start console interface with the default console reader
|
void |
startConsole(ConsoleReader consoleReader)
Start console interface with consoleReader
|
public CLICommandConsole(CommandManager commandManager)
commandManager
- A command manager object.public void executeMany(java.lang.String line) throws java.lang.Exception
ShellParser
.line
- commands. Commands should be separated by ';'java.lang.Exception
- Commands may throw Exception.public void executeMany(java.lang.String[] args) throws java.lang.Exception
args
- commands. Commands should be separated by ';'java.lang.Exception
- Commands may throw Exception.public void execute(java.lang.String line) throws java.lang.Exception
ShellParser
.line
- a command and its arguments.java.lang.Exception
- A command may throw Exception.public void execute(java.lang.String[] args) throws java.lang.Exception
args
- a command and its arguments.java.lang.Exception
- A command may throw Exception.public ManagedCommand getConfiguredCommandInstance(java.lang.String line) throws java.lang.Exception
ShellParser
.line
- a command and its arguments.java.lang.Exception
- A argument parser may throw Exception.public ManagedCommand getConfiguredCommandInstance(java.lang.String[] args) throws java.lang.Exception
args
- a command and its arguments.java.lang.Exception
- A argument parser may throw Exception.public void loadScript(java.io.Reader reader) throws java.lang.Exception
reader
- script readerjava.lang.Exception
- commands may throw Exceptionpublic void startConsole() throws java.io.IOException
java.io.IOException
- console reade may throw IOExceptionpublic void startConsole(ConsoleReader consoleReader) throws java.io.IOException
consoleReader
- terminal console readerjava.io.IOException
- console reade may throw IOExceptionpublic CommandManager getCommandManager()