Package picocli
Class CommandLine.ParameterException
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
Exception indicating something went wrong while parsing command line options.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CommandLine.Model.ArgSpecprotected final CommandLineprivate static final longprivate String -
Constructor Summary
ConstructorsConstructorDescriptionParameterException(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
Modifier and TypeMethodDescriptionprivate static CommandLine.ParameterExceptioncreate(CommandLine cmd, Exception ex, String arg, int i, String[] args) Returns theArgSpecobject for the (sub)command whose input could not be parsed.Returns theCommandLineobject for the (sub)command whose input could not be parsed.getValue()Returns theStringvalue 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 Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
commandLine
-
argSpec
-
value
-
-
Constructor Details
-
ParameterException
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
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 Details
-
getCommandLine
Returns theCommandLineobject for the (sub)command whose input could not be parsed.- Returns:
- the
CommandLineobject for the (sub)command where parsing failed. - Since:
- 2.0
-
getArgSpec
Returns theArgSpecobject for the (sub)command whose input could not be parsed.- Returns:
- the
ArgSpecobject for the (sub)command where parsing failed. - Since:
- 3.2
-
getValue
Returns theStringvalue for the (sub)command whose input could not be parsed.- Returns:
- the
Stringvalue for the (sub)command where parsing failed. - Since:
- 3.2
-
create
private static CommandLine.ParameterException create(CommandLine cmd, Exception ex, String arg, int i, String[] args)
-