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()
Checks whether the argument accepts value.
|
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, isPresent, setAccessRequirement, setExclusive
protected 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()
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 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
CommandFormatException
public static String resolveValue(String value, ParsingState initialState) throws CommandFormatException
CommandFormatException
public 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
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 © 2023 JBoss by Red Hat. All rights reserved.