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)
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 CommandArgument getArgument(CommandContext ctx, String name)
CommandHandler
getArgument
in interface CommandHandler
ctx
- the current contextname
- the name of the argumentpublic boolean hasArgument(CommandContext ctx, String name)
CommandHandler
hasArgument
in interface CommandHandler
ctx
- the current contextname
- argument name to checkpublic boolean hasArgument(CommandContext ctx, int index)
CommandHandler
hasArgument
in interface CommandHandler
ctx
- the current contextindex
- argument index to checkpublic List<CommandArgument> getArguments(CommandContext ctx)
CommandHandler
getArguments
in interface CommandHandler
ctx
- current command line contextCopyright © 2023 JBoss by Red Hat. All rights reserved.