public abstract class CommandHandlerWithHelp extends CommandHandlerWithArguments
| Modifier and Type | Field and Description |
|---|---|
protected ArgumentWithoutValue |
helpArg |
| Constructor and Description |
|---|
CommandHandlerWithHelp(String command) |
CommandHandlerWithHelp(String command,
boolean connectionRequired) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doHandle(CommandContext ctx) |
void |
handle(CommandContext ctx)
Executes the command.
|
boolean |
isAvailable(CommandContext ctx)
Checks whether the command is available in the current context
(e.g.
|
boolean |
isBatchMode(CommandContext ctx)
Whether the command supports batch mode or not.
|
protected void |
printHelp(CommandContext ctx) |
protected void |
printList(CommandContext ctx,
Collection<String> list,
boolean l)
Prints a list of strings.
|
addArgument, getArgument, getArguments, hasArgument, hasArgument, recognizeArgumentsprotected ArgumentWithoutValue helpArg
public CommandHandlerWithHelp(String command)
public CommandHandlerWithHelp(String command, boolean connectionRequired)
public boolean isAvailable(CommandContext ctx)
CommandHandlerctx - current contextpublic void handle(CommandContext ctx) throws CommandLineException
CommandHandlerctx - current command contextCommandLineException - if for any reason the command can't be properly handled
the implementation must throw an instance of CommandLineException.protected void printHelp(CommandContext ctx) throws CommandLineException
CommandLineExceptionprotected abstract void doHandle(CommandContext ctx) throws CommandLineException
CommandLineExceptionpublic boolean isBatchMode(CommandContext ctx)
CommandHandlerctx - the current contextprotected void printList(CommandContext ctx, Collection<String> list, boolean l)
ctx - the contextlist - the list to printCopyright © 2014 JBoss by Red Hat. All rights reserved.