Module net.sourceforge.argparse4j
Class ConstructorArgumentType<T>
java.lang.Object
net.sourceforge.argparse4j.impl.type.ConstructorArgumentType<T>
- All Implemented Interfaces:
ArgumentType<T>
Deprecated.
This implementation converts String value into given type using given type's constructor.
The constructor must have 1 String argument. If error occurred inside the
constructor, ArgumentParserException will be thrown. If error
occurred in other locations, subclass of RuntimeException will be
thrown.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructorArgumentType(Class<T> type) Deprecated.CreatesConstructorArgumentTypeobject with giventype. -
Method Summary
Modifier and TypeMethodDescriptionconvert(ArgumentParser parser, Argument arg, String value) Deprecated.Convertsvalueto appropriate type.private voidDeprecated.
-
Field Details
-
type_
Deprecated.
-
-
Constructor Details
-
ConstructorArgumentType
Deprecated.Creates
ConstructorArgumentTypeobject with giventype.The constructor of
typemust have 1 String argument.- Parameters:
type- The type String value should be converted to.
-
-
Method Details
-
convert
Deprecated.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<T>- Parameters:
parser- The parser.arg- The argument this type attached to.value- The attribute value.- Returns:
- Converted object.
- Throws:
ArgumentParserException- If conversion fails.
-
handleInstantiationError
Deprecated.
-
ReflectArgumentTypeinstead.