public abstract class CommandHandlerWithArguments extends Object implements CommandHandler
Constructor and Description |
---|
CommandHandlerWithArguments() |
Modifier and Type | Method and Description |
---|---|
void |
addArgument(CommandArgument arg) |
CommandArgument |
getArgument(CommandContext ctx,
String name)
Returns command argument declared by the command handler
corresponding to the argument name.
|
Collection<CommandArgument> |
getArguments(CommandContext ctx)
Returns a collection of the command arguments the handler supports in the current context.
|
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.
|
protected void |
recognizeArguments(CommandContext ctx) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handle, isAvailable, isBatchMode
public void addArgument(CommandArgument arg)
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 Collection<CommandArgument> getArguments(CommandContext ctx)
CommandHandler
getArguments
in interface CommandHandler
ctx
- current command line contextprotected void recognizeArguments(CommandContext ctx) throws CommandFormatException
CommandFormatException
Copyright © 2023 JBoss by Red Hat. All rights reserved.