Package org.apache.commons.cli
Class ParseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.apache.commons.cli.ParseException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
AlreadySelectedException,MissingArgumentException,MissingOptionException,UnrecognizedOptionException
public class ParseException extends java.lang.Exception
Base for Exceptions thrown during parsing of a command-line.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ParseException(java.lang.String message)Constructs a newParseExceptionwith the specified detail message.ParseException(java.lang.Throwable e)Constructs a newParseExceptionwrapping the specified exception.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ParseExceptionwrap(java.lang.Throwable e)Converts any exception exceptUnsupportedOperationExceptionto aParseException.
-
-
-
Constructor Detail
-
ParseException
public ParseException(java.lang.String message)
Constructs a newParseExceptionwith the specified detail message.- Parameters:
message- the detail message
-
ParseException
public ParseException(java.lang.Throwable e)
Constructs a newParseExceptionwrapping the specified exception.- Parameters:
e- the Exception to wrap.
-
-
Method Detail
-
wrap
public static ParseException wrap(java.lang.Throwable e) throws java.lang.UnsupportedOperationException
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:
java.lang.UnsupportedOperationException- due to legacy expectations. Will be removed in the future.- Since:
- 1.7.0
-
-