public class ArgumentWithValue extends ArgumentWithoutValue
cantAppearAfter, exclusive, fullName, index, requiredPreceding, shortName
Constructor and Description |
---|
ArgumentWithValue(CommandHandlerWithArguments handler,
CommandLineCompleter valueCompleter,
ArgumentValueConverter valueConverter,
String fullName) |
ArgumentWithValue(CommandHandlerWithArguments handler,
CommandLineCompleter valueCompleter,
ArgumentValueConverter valueConverter,
String fullName,
String shortName) |
ArgumentWithValue(CommandHandlerWithArguments handler,
CommandLineCompleter valueCompleter,
int index,
String fullName) |
ArgumentWithValue(CommandHandlerWithArguments handler,
CommandLineCompleter valueCompleter,
String fullName) |
ArgumentWithValue(CommandHandlerWithArguments handler,
int index,
String fullName) |
ArgumentWithValue(CommandHandlerWithArguments handler,
String fullName) |
ArgumentWithValue(CommandHandlerWithArguments handler,
String fullName,
String shortName) |
Modifier and Type | Method and Description |
---|---|
String |
getValue(ParsedCommandLine args,
boolean required)
Returns the value of the argument specified on the command line.
|
CommandLineCompleter |
getValueCompleter()
Returns the tab-completer for the value.
|
ArgumentValueConverter |
getValueConverter() |
boolean |
isValueComplete(ParsedCommandLine args)
Checks whether the value is specified and complete.
|
boolean |
isValueRequired()
Checks whether the argument accepts value.
|
addCantAppearAfter, addRequiredPreceding, canAppearNext, getFullName, getIndex, getShortName, getValue, isPresent, setExclusive
public ArgumentWithValue(CommandHandlerWithArguments handler, String fullName)
public ArgumentWithValue(CommandHandlerWithArguments handler, CommandLineCompleter valueCompleter, String fullName)
public ArgumentWithValue(CommandHandlerWithArguments handler, CommandLineCompleter valueCompleter, ArgumentValueConverter valueConverter, String fullName)
public ArgumentWithValue(CommandHandlerWithArguments handler, String fullName, String shortName)
public ArgumentWithValue(CommandHandlerWithArguments handler, int index, String fullName)
public ArgumentWithValue(CommandHandlerWithArguments handler, CommandLineCompleter valueCompleter, int index, String fullName)
public ArgumentWithValue(CommandHandlerWithArguments handler, CommandLineCompleter valueCompleter, ArgumentValueConverter valueConverter, String fullName, String shortName)
public CommandLineCompleter getValueCompleter()
CommandArgument
getValueCompleter
in interface CommandArgument
getValueCompleter
in class ArgumentWithoutValue
public String getValue(ParsedCommandLine args, boolean required) throws CommandFormatException
CommandArgument
getValue
in interface CommandArgument
getValue
in class ArgumentWithoutValue
args
- parsed arguments.required
- whether the value for this argument is required.CommandFormatException
public boolean isValueRequired()
CommandArgument
isValueRequired
in interface CommandArgument
isValueRequired
in class ArgumentWithoutValue
public boolean isValueComplete(ParsedCommandLine args) throws CommandFormatException
CommandArgument
isValueComplete
in interface CommandArgument
isValueComplete
in class ArgumentWithoutValue
args
- the parsed argumentsCommandFormatException
public ArgumentValueConverter getValueConverter()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.