- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- picocli.CommandLine.PicocliException
-
- picocli.CommandLine.ParameterException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CommandLine.MaxValuesExceededException
,CommandLine.MissingParameterException
,CommandLine.MissingTypeConverterException
,CommandLine.MutuallyExclusiveArgsException
,CommandLine.OverwrittenOptionException
,CommandLine.UnmatchedArgumentException
- Enclosing class:
- CommandLine
public static class CommandLine.ParameterException extends CommandLine.PicocliException
Exception indicating something went wrong while parsing command line options.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected CommandLine
commandLine
-
Constructor Summary
Constructors Constructor Description ParameterException(CommandLine commandLine, String msg)
Constructs a new ParameterException with the specified CommandLine and error message.ParameterException(CommandLine commandLine, String msg, Throwable t)
Constructs a new ParameterException with the specified CommandLine and error message.ParameterException(CommandLine commandLine, String msg, Throwable t, CommandLine.Model.ArgSpec argSpec, String value)
Constructs a new ParameterException with the specified CommandLine and error message.ParameterException(CommandLine commandLine, String msg, CommandLine.Model.ArgSpec argSpec, 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 theArgSpec
object for the (sub)command whose input could not be parsed.CommandLine
getCommandLine()
Returns theCommandLine
object for the (sub)command whose input could not be parsed.String
getValue()
Returns theString
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
-
-
-
-
Field Detail
-
commandLine
protected final CommandLine commandLine
-
-
Constructor Detail
-
ParameterException
public ParameterException(CommandLine commandLine, String msg)
Constructs a new ParameterException with the specified CommandLine and error message.- Parameters:
commandLine
- the command or subcommand whose input was invalidmsg
- describes the problem- Since:
- 2.0
-
ParameterException
public ParameterException(CommandLine commandLine, String msg, Throwable t)
Constructs a new ParameterException with the specified CommandLine and error message.- Parameters:
commandLine
- the command or subcommand whose input was invalidmsg
- describes the problemt
- the throwable that caused this ParameterException- Since:
- 2.0
-
ParameterException
public ParameterException(CommandLine commandLine, String msg, Throwable t, CommandLine.Model.ArgSpec argSpec, String value)
Constructs a new ParameterException with the specified CommandLine and error message.- Parameters:
commandLine
- the command or subcommand whose input was invalidmsg
- describes the problemt
- the throwable that caused this ParameterExceptionargSpec
- the argSpec that caused this ParameterExceptionvalue
- the value that caused this ParameterException- Since:
- 3.2
-
ParameterException
public ParameterException(CommandLine commandLine, String msg, CommandLine.Model.ArgSpec argSpec, String value)
Constructs a new ParameterException with the specified CommandLine and error message.- Parameters:
commandLine
- the command or subcommand whose input was invalidmsg
- describes the problemargSpec
- the argSpec that caused this ParameterExceptionvalue
- the value that caused this ParameterException- Since:
- 3.2
-
-
Method Detail
-
getCommandLine
public CommandLine getCommandLine()
Returns theCommandLine
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 theArgSpec
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 String getValue()
Returns theString
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
-
-