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)
Handles the execution of 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,
List<String> list,
boolean l)
Prints a list of strings.
|
addArgument, getArguments, hasArgument, hasArgument
protected ArgumentWithoutValue helpArg
public CommandHandlerWithHelp(String command)
public CommandHandlerWithHelp(String command, boolean connectionRequired)
public boolean isAvailable(CommandContext ctx)
CommandHandler
ctx
- current contextpublic void handle(CommandContext ctx) throws CommandFormatException
CommandHandler
ctx
- current command contextCommandFormatException
protected void printHelp(CommandContext ctx)
protected abstract void doHandle(CommandContext ctx) throws CommandFormatException
CommandFormatException
public boolean isBatchMode(CommandContext ctx)
CommandHandler
ctx
- the current contextprotected void printList(CommandContext ctx, List<String> list, boolean l)
ctx
- the contextlist
- the list to printCopyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.