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.ExceptionA 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 voidaddException(java.lang.Throwable ex)Adds an exception to the collection.voidaddException(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.StringgetMessage()Returns the error message, including the message from all contained exceptions.booleanisFatal()Get the value of fatal.voidprintStackTrace(java.io.PrintStream s)Prints the stack trace.voidprintStackTrace(java.io.PrintWriter s)Prints the stack trace.voidsetFatal(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:
printStackTracein classjava.lang.Throwable- Parameters:
s- the writer to print to
-
printStackTrace
public void printStackTrace(java.io.PrintStream s)
Prints the stack trace.- Overrides:
printStackTracein 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:
getMessagein classjava.lang.Throwable- Returns:
- the error message
-
-