public class StringArgumentType extends Object implements ArgumentType<String>
Constructor and Description |
---|
StringArgumentType() |
Modifier and Type | Method and Description |
---|---|
String |
convert(ArgumentParser parser,
Argument arg,
String value)
Converts
value to appropriate type. |
public String convert(ArgumentParser parser, Argument arg, String value) throws ArgumentParserException
ArgumentType
Converts value
to appropriate type.
If the objects derived from RuntimeException
are thrown in
conversion because of invalid input from command line, subclass must
catch these exceptions and wrap them in ArgumentParserException
and give simple error message to explain what happened briefly.
convert
in interface ArgumentType<String>
parser
- The parser.arg
- The argument this type attached to.value
- The attribute value.ArgumentParserException
- If conversion fails.Copyright © 2012–2017. All rights reserved.