Class ExceptionCollection
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.owasp.dependencycheck.exception.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.
-
-
-
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 exceptionsfatal
- 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 exceptionsfatal
- 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 addfatal
- 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 classjava.lang.Throwable
- Parameters:
s
- the writer to print to
-
printStackTrace
public void printStackTrace(java.io.PrintStream s)
Prints the stack trace.- Overrides:
printStackTrace
in classjava.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 classjava.lang.Throwable
- Returns:
- the error message
-
-