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, recognizeArguments
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 CommandLineException
CommandHandler
ctx
- 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
CommandLineException
protected abstract void doHandle(CommandContext ctx) throws CommandLineException
CommandLineException
public boolean isBatchMode(CommandContext ctx)
CommandHandler
ctx
- the current contextprotected void printList(CommandContext ctx, Collection<String> list, boolean l)
ctx
- the contextlist
- the list to printCopyright © 2023 JBoss by Red Hat. All rights reserved.