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
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
This exceptionserialVersionUID
.
-
Constructor Summary
Constructors Constructor Description ParseException(java.lang.String message)
Constructs a newParseException
with the specified detail message.ParseException(java.lang.Throwable e)
Constructs a newParseException
wrapping the specified exception.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ParseException
wrap(java.lang.Throwable e)
Converts any exception exceptUnsupportedOperationException
to aParseException
.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
This exceptionserialVersionUID
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ParseException
public ParseException(java.lang.String message)
Constructs a newParseException
with the specified detail message.- Parameters:
message
- the detail message
-
ParseException
public ParseException(java.lang.Throwable e)
Constructs a newParseException
wrapping 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 exceptUnsupportedOperationException
to aParseException
. ife
is an instance ofParseException
it is returned, otherwise aParseException
is created that wraps it.Note:
UnsupportedOperationException
are 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
-
-