Package picocli

Class CommandLine.ParameterException

    • Constructor Summary

      Constructors 
      Constructor Description
      ParameterException​(CommandLine commandLine, java.lang.String msg)
      Constructs a new ParameterException with the specified CommandLine and error message.
      ParameterException​(CommandLine commandLine, java.lang.String msg, java.lang.Throwable t)
      Constructs a new ParameterException with the specified CommandLine and error message.
      ParameterException​(CommandLine commandLine, java.lang.String msg, java.lang.Throwable t, CommandLine.Model.ArgSpec argSpec, java.lang.String value)
      Constructs a new ParameterException with the specified CommandLine and error message.
      ParameterException​(CommandLine commandLine, java.lang.String msg, CommandLine.Model.ArgSpec argSpec, java.lang.String value)
      Constructs a new ParameterException with the specified CommandLine and error message.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CommandLine.Model.ArgSpec getArgSpec()
      Returns the ArgSpec object for the (sub)command whose input could not be parsed.
      CommandLine getCommandLine()
      Returns the CommandLine object for the (sub)command whose input could not be parsed.
      java.lang.String getValue()
      Returns the String value for the (sub)command whose input could not be parsed.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • ParameterException

        public ParameterException​(CommandLine commandLine,
                                  java.lang.String msg)
        Constructs a new ParameterException with the specified CommandLine and error message.
        Parameters:
        commandLine - the command or subcommand whose input was invalid
        msg - describes the problem
        Since:
        2.0
      • ParameterException

        public ParameterException​(CommandLine commandLine,
                                  java.lang.String msg,
                                  java.lang.Throwable t)
        Constructs a new ParameterException with the specified CommandLine and error message.
        Parameters:
        commandLine - the command or subcommand whose input was invalid
        msg - describes the problem
        t - the throwable that caused this ParameterException
        Since:
        2.0
      • ParameterException

        public ParameterException​(CommandLine commandLine,
                                  java.lang.String msg,
                                  java.lang.Throwable t,
                                  CommandLine.Model.ArgSpec argSpec,
                                  java.lang.String value)
        Constructs a new ParameterException with the specified CommandLine and error message.
        Parameters:
        commandLine - the command or subcommand whose input was invalid
        msg - describes the problem
        t - the throwable that caused this ParameterException
        argSpec - the argSpec that caused this ParameterException
        value - the value that caused this ParameterException
        Since:
        3.2
      • ParameterException

        public ParameterException​(CommandLine commandLine,
                                  java.lang.String msg,
                                  CommandLine.Model.ArgSpec argSpec,
                                  java.lang.String value)
        Constructs a new ParameterException with the specified CommandLine and error message.
        Parameters:
        commandLine - the command or subcommand whose input was invalid
        msg - describes the problem
        argSpec - the argSpec that caused this ParameterException
        value - the value that caused this ParameterException
        Since:
        3.2
    • Method Detail

      • getCommandLine

        public CommandLine getCommandLine()
        Returns the CommandLine object for the (sub)command whose input could not be parsed.
        Returns:
        the CommandLine object for the (sub)command where parsing failed.
        Since:
        2.0
      • getArgSpec

        public CommandLine.Model.ArgSpec getArgSpec()
        Returns the ArgSpec object for the (sub)command whose input could not be parsed.
        Returns:
        the ArgSpec object for the (sub)command where parsing failed.
        Since:
        3.2
      • getValue

        public java.lang.String getValue()
        Returns the String value for the (sub)command whose input could not be parsed.
        Returns:
        the String value for the (sub)command where parsing failed.
        Since:
        3.2