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 |
---|---|
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(int index)
Checks whether the command handler accepts an argument with the specified index.
|
boolean |
hasArgument(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)
CommandHandler
isAvailable
in interface CommandHandler
ctx
- current contextpublic boolean isBatchMode(CommandContext ctx)
CommandHandler
isBatchMode
in interface CommandHandler
ctx
- the current contextpublic void handle(CommandContext ctx) throws CommandFormatException
CommandHandler
handle
in interface CommandHandler
ctx
- current command contextCommandFormatException
public boolean hasArgument(String name)
CommandHandler
hasArgument
in interface CommandHandler
name
- argument name to checkpublic boolean hasArgument(int index)
CommandHandler
hasArgument
in interface CommandHandler
index
- argument index to checkpublic List<CommandArgument> getArguments(CommandContext ctx)
CommandHandler
getArguments
in interface CommandHandler
ctx
- current command line contextCopyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.