public class VersionHandler extends Object implements CommandHandler
| Modifier and Type | Field and Description |
|---|---|
static VersionHandler |
INSTANCE |
| Constructor and Description |
|---|
VersionHandler() |
| Modifier and Type | Method and Description |
|---|---|
CommandArgument |
getArgument(CommandContext ctx,
String name)
Returns command argument declared by the command handler
corresponding to the argument name.
|
List<CommandArgument> |
getArguments(CommandContext ctx)
Returns a collection of the command arguments the handler supports in the current context.
|
void |
handle(CommandContext ctx)
Executes the command.
|
boolean |
hasArgument(CommandContext ctx,
int index)
Checks whether the command handler accepts an argument with the specified index.
|
boolean |
hasArgument(CommandContext ctx,
String name)
Checks whether the command handler recognizes the argument by the name.
|
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.
|
public static final VersionHandler INSTANCE
public boolean isAvailable(CommandContext ctx)
CommandHandlerisAvailable in interface CommandHandlerctx - current contextpublic boolean isBatchMode(CommandContext ctx)
CommandHandlerisBatchMode in interface CommandHandlerctx - the current contextpublic void handle(CommandContext ctx) throws CommandFormatException
CommandHandlerhandle in interface CommandHandlerctx - current command contextCommandFormatExceptionpublic CommandArgument getArgument(CommandContext ctx, String name)
CommandHandlergetArgument in interface CommandHandlerctx - the current contextname - the name of the argumentpublic boolean hasArgument(CommandContext ctx, String name)
CommandHandlerhasArgument in interface CommandHandlerctx - the current contextname - argument name to checkpublic boolean hasArgument(CommandContext ctx, int index)
CommandHandlerhasArgument in interface CommandHandlerctx - the current contextindex - argument index to checkpublic List<CommandArgument> getArguments(CommandContext ctx)
CommandHandlergetArguments in interface CommandHandlerctx - current command line contextCopyright © 2014 JBoss by Red Hat. All rights reserved.