Class ParseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.commons.cli.ParseException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AlreadySelectedException, MissingArgumentException, MissingOptionException, UnrecognizedOptionException
Base for Exceptions thrown during parsing of a command-line.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionParseException(String message) Constructs a newParseExceptionwith the specified detail message.Constructs a newParseExceptionwrapping the specified exception. -
Method Summary
Modifier and TypeMethodDescriptionstatic ParseExceptionConverts any exception exceptUnsupportedOperationExceptionto aParseException. ifeis an instance ofParseExceptionit is returned, otherwise aParseExceptionis created that wraps it.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ParseException
Constructs a newParseExceptionwith the specified detail message.- Parameters:
message- the detail message.
-
ParseException
Constructs a newParseExceptionwrapping the specified exception.- Parameters:
e- the Exception to wrap.
-
-
Method Details
-
wrap
Converts any exception exceptUnsupportedOperationExceptionto aParseException. ifeis an instance ofParseExceptionit is returned, otherwise aParseExceptionis created that wraps it.Note:
UnsupportedOperationExceptionare not wrapped. This is to solve a legacy expected exception problem and will be removed in the future.- Parameters:
e- the exception to convert.- Returns:
- the ParseException.
- Throws:
UnsupportedOperationException- due to legacy expectations. Will be removed in the future.- Since:
- 1.7.0
-