Class ExceptionCollection

  • All Implemented Interfaces:
    java.io.Serializable

    @NotThreadSafe
    public class ExceptionCollection
    extends java.lang.Exception
    A collection of several exceptions.
    Author:
    Jeremy Long
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ExceptionCollection()
      Instantiates a new exception collection.
      ExceptionCollection​(java.lang.Throwable exception)
      Instantiates a new exception collection.
      ExceptionCollection​(java.lang.Throwable exception, boolean fatal)
      Instantiates a new exception collection.
      ExceptionCollection​(java.util.List<java.lang.Throwable> exceptions)
      Instantiates a new exception collection.
      ExceptionCollection​(java.util.List<java.lang.Throwable> exceptions, boolean fatal)
      Instantiates a new exception collection.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addException​(java.lang.Throwable ex)
      Adds an exception to the collection.
      void addException​(java.lang.Throwable ex, boolean fatal)
      Adds an exception to the collection.
      java.util.List<java.lang.Throwable> getExceptions()
      Get the value of exceptions.
      java.lang.String getMessage()
      Returns the error message, including the message from all contained exceptions.
      boolean isFatal()
      Get the value of fatal.
      void printStackTrace​(java.io.PrintStream s)
      Prints the stack trace.
      void printStackTrace​(java.io.PrintWriter s)
      Prints the stack trace.
      void setFatal​(boolean fatal)
      Set the value of fatal.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ExceptionCollection

        public ExceptionCollection​(java.util.List<java.lang.Throwable> exceptions)
        Instantiates a new exception collection.
        Parameters:
        exceptions - a list of exceptions
      • ExceptionCollection

        public ExceptionCollection​(java.util.List<java.lang.Throwable> exceptions,
                                   boolean fatal)
        Instantiates a new exception collection.
        Parameters:
        exceptions - a list of exceptions
        fatal - indicates if any of the exceptions that occurred is fatal - meaning that no analysis was performed.
      • ExceptionCollection

        public ExceptionCollection​(java.lang.Throwable exception,
                                   boolean fatal)
        Instantiates a new exception collection.
        Parameters:
        exception - a list of exceptions
        fatal - indicates if the exception that occurred is fatal - meaning that no analysis was performed.
      • ExceptionCollection

        public ExceptionCollection​(java.lang.Throwable exception)
        Instantiates a new exception collection.
        Parameters:
        exception - a list of exceptions
      • ExceptionCollection

        public ExceptionCollection()
        Instantiates a new exception collection.
    • Method Detail

      • getExceptions

        public java.util.List<java.lang.Throwable> getExceptions()
        Get the value of exceptions.
        Returns:
        the value of exceptions
      • addException

        public void addException​(java.lang.Throwable ex)
        Adds an exception to the collection.
        Parameters:
        ex - the exception to add
      • addException

        public void addException​(java.lang.Throwable ex,
                                 boolean fatal)
        Adds an exception to the collection.
        Parameters:
        ex - the exception to add
        fatal - flag indicating if this is a fatal error
      • isFatal

        public boolean isFatal()
        Get the value of fatal.
        Returns:
        the value of fatal
      • setFatal

        public void setFatal​(boolean fatal)
        Set the value of fatal.
        Parameters:
        fatal - new value of fatal
      • printStackTrace

        public void printStackTrace​(java.io.PrintWriter s)
        Prints the stack trace.
        Overrides:
        printStackTrace in class java.lang.Throwable
        Parameters:
        s - the writer to print to
      • printStackTrace

        public void printStackTrace​(java.io.PrintStream s)
        Prints the stack trace.
        Overrides:
        printStackTrace in class java.lang.Throwable
        Parameters:
        s - the stream to write the stack trace to
      • getMessage

        public java.lang.String getMessage()
        Returns the error message, including the message from all contained exceptions.
        Overrides:
        getMessage in class java.lang.Throwable
        Returns:
        the error message