Package org.apache.commons.cli
Class MissingOptionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.commons.cli.ParseException
org.apache.commons.cli.MissingOptionException
- All Implemented Interfaces:
Serializable
Thrown when a required option has not been provided.
- Version:
- $Id: MissingOptionException.java 1443102 2013-02-06 18:12:16Z tn $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List
The list of missing options and groupsprivate static final long
This exceptionserialVersionUID
. -
Constructor Summary
ConstructorsConstructorDescriptionMissingOptionException
(String message) Construct a newMissingSelectedException
with the specified detail message.MissingOptionException
(List missingOptions) Constructs a newMissingSelectedException
with the specified list of missing options. -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
createMessage
(List<?> missingOptions) Build the exception message from the specified list of options.Returns the list of options or option groups missing in the command line 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 serialVersionUIDThis exceptionserialVersionUID
.- See Also:
-
missingOptions
The list of missing options and groups
-
-
Constructor Details
-
MissingOptionException
Construct a newMissingSelectedException
with the specified detail message.- Parameters:
message
- the detail message
-
MissingOptionException
Constructs a newMissingSelectedException
with the specified list of missing options.- Parameters:
missingOptions
- the list of missing options and groups- Since:
- 1.2
-
-
Method Details
-
getMissingOptions
Returns the list of options or option groups missing in the command line parsed.- Returns:
- the missing options, consisting of String instances for simple options, and OptionGroup instances for required option groups.
- Since:
- 1.2
-
createMessage
Build the exception message from the specified list of options.- Parameters:
missingOptions
- the list of missing options and groups- Since:
- 1.2
-