public class CliCommandHandler extends java.lang.Object implements CommandHandler
CommandHandler which handles basic commands of type CliCommandType| Constructor and Description |
|---|
CliCommandHandler() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
handleCommand(CliCommand command)
Handles the given command
|
void |
init(CliShell shell,
CliEnvironment env,
org.jline.terminal.Terminal terminal,
ExecutionContext exeContext)
sets up the member variables
|
CliCommand |
parseLine(java.lang.String line)
Attempts to parse the given input string line into a
CliCommand of this
handler's CommandType |
void |
printHelpMessage()
Prints to terminal the help message of the commands this handler handles
|
public void init(CliShell shell, CliEnvironment env, org.jline.terminal.Terminal terminal, ExecutionContext exeContext)
init in interface CommandHandlershell: - the CliShell which uses this CommandHandlerenv: - the Shell's CliEnvironmentterminal: - the Terminal to print output and messagesexeContext: - the ExecutionContextpublic CliCommand parseLine(java.lang.String line)
CliCommand of this
handler's CommandTypeparseLine in interface CommandHandlerline: - input line stringCliCommand on success, null otherwisepublic void printHelpMessage()
printHelpMessage in interface CommandHandlerpublic boolean handleCommand(CliCommand command) throws CommandHandlerException
handleCommand in interface CommandHandlercommand: - input CliCommand to handleCommandHandlerException - if unrecoverable error happened while handling the input CliCommand