Class JSAPException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.martiansoftware.jsap.JSAPException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
IllegalMultipleDeclarationException, ParseException, RequiredParameterMissingException, SyntaxException, UnknownFlagException

public class JSAPException
extends java.lang.Exception
The base class for all of JSAP's exceptions. A JSAPException can encapsulate another Exception, which can be obtained via the getRootCause() method. This is useful in cases where subclasses might need to throw an exception that JSAP is not expecting, such as an IOException while loading a DefaultSource. The subclass can in these cases throw a new JSAPException encapsulating the IOException.
Author:
Marty Lamb
See Also:
Flagged, Option, Serialized Form
  • Constructor Summary

    Constructors
    Constructor Description
    JSAPException()
    Creates a new JSAPException.
    JSAPException​(java.lang.String msg)
    Creates a new JSAPException with the specified message.
    JSAPException​(java.lang.String msg, java.lang.Throwable cause)
    Creates a new JSAPException with the specified message encapsulating the specified Throwable.
    JSAPException​(java.lang.Throwable cause)
    Creates a new JSAPException encapsulating the specified Throwable.
  • Method Summary

    Methods inherited from class java.lang.Throwable

    addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • JSAPException

      public JSAPException()
      Creates a new JSAPException.
    • JSAPException

      public JSAPException​(java.lang.String msg)
      Creates a new JSAPException with the specified message.
      Parameters:
      msg - the message for this JSAPException.
    • JSAPException

      public JSAPException​(java.lang.Throwable cause)
      Creates a new JSAPException encapsulating the specified Throwable.
      Parameters:
      cause - the Throwable to encapsulate.
    • JSAPException

      public JSAPException​(java.lang.String msg, java.lang.Throwable cause)
      Creates a new JSAPException with the specified message encapsulating the specified Throwable.
      Parameters:
      msg - the message for this JSAPException.
      cause - the Throwable to encapsulate.