Package picocli

Class CommandLine.BuiltIn.ClassConverter

java.lang.Object
picocli.CommandLine.BuiltIn.ClassConverter
All Implemented Interfaces:
CommandLine.ITypeConverter<Class<?>>
Enclosing class:
CommandLine.BuiltIn

static class CommandLine.BuiltIn.ClassConverter extends Object implements CommandLine.ITypeConverter<Class<?>>
  • Constructor Details

    • ClassConverter

      ClassConverter()
  • Method Details

    • convert

      public Class<?> convert(String s) throws Exception
      Description copied from interface: CommandLine.ITypeConverter
      Converts the specified command line argument value to some domain object.
      Specified by:
      convert in interface CommandLine.ITypeConverter<Class<?>>
      Parameters:
      s - the command line argument String value
      Returns:
      the resulting domain object
      Throws:
      Exception - an exception detailing what went wrong during the conversion. Any exception thrown from this method will be caught and shown to the end user. An example error message shown to the end user could look something like this: Invalid value for option '--some-option': cannot convert 'xxxinvalidinput' to SomeType (java.lang.IllegalArgumentException: Invalid format: must be 'x:y:z' but was 'xxxinvalidinput')