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.Stringconvert(ArgumentParser parser, Argument arg, java.lang.String value)Convertsvalueto appropriate type.
-
-
-
Method Detail
-
convert
public java.lang.String convert(ArgumentParser parser, Argument arg, java.lang.String value)
Description copied from interface:ArgumentTypeConverts
valueto appropriate type.If the objects derived from
RuntimeExceptionare thrown in conversion because of invalid input from command line, subclass must catch these exceptions and wrap them inArgumentParserExceptionand give simple error message to explain what happened briefly.- Specified by:
convertin interfaceArgumentType<java.lang.String>- Parameters:
parser- The parser.arg- The argument this type attached to.value- The attribute value.- Returns:
- Converted object.
-
-