Module net.sourceforge.argparse4j
Class StringArgumentType
- java.lang.Object
-
- net.sourceforge.argparse4j.impl.type.StringArgumentType
-
- All Implemented Interfaces:
ArgumentType<java.lang.String>
public class StringArgumentType extends java.lang.Object implements ArgumentType<java.lang.String>
Specialized to String type, just echos back given string.
-
-
Constructor Summary
Constructors Constructor Description StringArgumentType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
convert(ArgumentParser parser, Argument arg, java.lang.String value)
Convertsvalue
to appropriate type.
-
-
-
Method Detail
-
convert
public java.lang.String convert(ArgumentParser parser, Argument arg, java.lang.String value)
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<java.lang.String>
- Parameters:
parser
- The parser.arg
- The argument this type attached to.value
- The attribute value.- Returns:
- Converted object.
-
-