public class ArgumentWithValue extends ArgumentWithoutValue
| Modifier and Type | Field and Description |
|---|---|
protected ParsingState |
initialState
initial state for value parsing
|
access, 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) |
| Modifier and Type | Method and Description |
|---|---|
String |
getOriginalValue(ParsedCommandLine parsedLine,
boolean required)
Returns value as it appeared on the command line with escape sequences
and system properties not resolved.
|
String |
getResolvedValue(ParsedCommandLine parsedLine,
boolean required)
Calls getOriginalValue(ParsedCommandLine parsedLine, boolean required) and correctly
handles escape sequences and resolves system properties.
|
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() |
protected ParsingState |
initParsingState() |
boolean |
isValueComplete(ParsedCommandLine args)
Checks whether the value is specified and complete.
|
boolean |
isValueRequired()
Argument can only appear if not already present in the parsed command
BUT
this is not all the time true, for example, an argument cannot appear
AFTER some other arguments.
|
static String |
resolveValue(String value) |
static String |
resolveValue(String value,
ParsingState initialState) |
org.jboss.dmr.ModelNode |
toModelNode(CommandContext ctx) |
addCantAppearAfter, addRequiredPreceding, canAppearNext, getFullName, getIndex, getShortName, getValue, isExclusive, isPresent, setAccessRequirement, setExclusiveclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDecoratedNameprotected final ParsingState initialState
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, 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)
protected ParsingState initParsingState()
public CommandLineCompleter getValueCompleter()
CommandArgumentgetValueCompleter in interface CommandArgumentgetValueCompleter in class ArgumentWithoutValuepublic String getValue(ParsedCommandLine args, boolean required) throws CommandFormatException
CommandArgumentgetValue in interface CommandArgumentgetValue in class ArgumentWithoutValueargs - parsed arguments.required - whether the value for this argument is required.CommandFormatExceptionpublic String getResolvedValue(ParsedCommandLine parsedLine, boolean required) throws CommandFormatException
parsedLine - parsed command linerequired - whether the argument is requiredCommandFormatException - in case the required argument is missingpublic static String resolveValue(String value) throws CommandFormatException
CommandFormatExceptionpublic static String resolveValue(String value, ParsingState initialState) throws CommandFormatException
CommandFormatExceptionpublic String getOriginalValue(ParsedCommandLine parsedLine, boolean required) throws CommandFormatException
parsedLine - parsed command linerequired - whether the argument is requiredCommandFormatException - in case the required argument is missingpublic org.jboss.dmr.ModelNode toModelNode(CommandContext ctx) throws CommandFormatException
CommandFormatExceptionpublic boolean isValueRequired()
isValueRequired in interface CommandArgumentisValueRequired in class ArgumentWithoutValuepublic boolean isValueComplete(ParsedCommandLine args) throws CommandFormatException
CommandArgumentisValueComplete in interface CommandArgumentisValueComplete in class ArgumentWithoutValueargs - the parsed argumentsCommandFormatExceptionpublic ArgumentValueConverter getValueConverter()
Copyright © 2018 JBoss by Red Hat. All rights reserved.