T
- Type this object convert to.public interface ArgumentType<T>
Modifier and Type | Method and Description |
---|---|
T |
convert(ArgumentParser parser,
Argument arg,
String value)
Converts
value to appropriate type. |
T convert(ArgumentParser parser, Argument arg, String value) throws ArgumentParserException
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.
parser
- The parser.arg
- The argument this type attached to.value
- The attribute value.ArgumentParserException
- If conversion fails.Copyright © 2012–2017. All rights reserved.