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:
java.io.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 private CommandLine.Model.ArgSpecargSpecprivate CommandLinecommandLineprivate static longserialVersionUIDprivate java.lang.Stringvalue
-
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 Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static CommandLine.ParameterExceptioncreate(CommandLine cmd, java.lang.Exception ex, java.lang.String arg, int i, java.lang.String[] args)CommandLine.Model.ArgSpecgetArgSpec()Returns theArgSpecobject for the (sub)command whose input could not be parsed.CommandLinegetCommandLine()Returns theCommandLineobject for the (sub)command whose input could not be parsed.java.lang.StringgetValue()Returns theStringvalue for the (sub)command whose input could not be parsed.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
commandLine
private final CommandLine commandLine
-
argSpec
private CommandLine.Model.ArgSpec argSpec
-
value
private java.lang.String value
-
-
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 invalidmsg- 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 invalidmsg- describes the problemt- 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 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, 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 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 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
public CommandLine.Model.ArgSpec 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
public java.lang.String 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, java.lang.Exception ex, java.lang.String arg, int i, java.lang.String[] args)
-
-