Class ConstructorArgumentType<T>

java.lang.Object
net.sourceforge.argparse4j.impl.type.ConstructorArgumentType<T>
All Implemented Interfaces:
ArgumentType<T>

public class ConstructorArgumentType<T> extends Object implements ArgumentType<T>
Deprecated.
Use ReflectArgumentType instead.

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.

  • Constructor Details

    • ConstructorArgumentType

      public ConstructorArgumentType(Class<T> type)
      Deprecated.

      Creates ConstructorArgumentType object with given type.

      The constructor of type must have 1 String argument.

      Parameters:
      type - The type String value should be converted to.
  • Method Details