Class StringArgumentType
java.lang.Object
net.sourceforge.argparse4j.impl.type.StringArgumentType
- All Implemented Interfaces:
ArgumentType<String>
Specialized to String type, just echos back given string.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvert
(ArgumentParser parser, Argument arg, String value) Convertsvalue
to appropriate type.
-
Constructor Details
-
StringArgumentType
public StringArgumentType()
-
-
Method Details
-
convert
public String convert(ArgumentParser parser, Argument arg, String value) throws ArgumentParserException Description copied from interface: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 inArgumentParserException
and give simple error message to explain what happened briefly.- Specified by:
convert
in interfaceArgumentType<String>
- Parameters:
parser
- The aprser.arg
- The argument this type attached to.value
- The attribute value.- Returns:
- Converted object.
- Throws:
ArgumentParserException
- If conversion fails.
-