Class Collector
- java.lang.Object
-
- org.glassfish.jersey.inject.cdi.se.injector.Collector
-
public class Collector extends Object
This class collects errors, and can then also produce a MultiException from those errors if necessary.- Author:
- John Wells (john.wells at oracle.com)
-
-
Constructor Summary
Constructors Constructor Description Collector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMultiException(MultiException me)MergesMultiExceptionwith allthrowablesregistered in it.voidaddThrowable(Throwable th)Adds a throwable to the list of throwables in this collector.booleanhasErrors()Returns true if this collector has errors.voidthrowIfErrors()This method will throw if the list of throwables associated with this collector is not empty.
-
-
-
Method Detail
-
addMultiException
public void addMultiException(MultiException me)
MergesMultiExceptionwith allthrowablesregistered in it.- Parameters:
me-MultiExceptionto merge.
-
addThrowable
public void addThrowable(Throwable th)
Adds a throwable to the list of throwables in this collector.- Parameters:
th- The throwable to add to the list.
-
throwIfErrors
public void throwIfErrors() throws MultiExceptionThis method will throw if the list of throwables associated with this collector is not empty.- Throws:
MultiException- An exception with all the throwables found in this collector.
-
hasErrors
public boolean hasErrors()
Returns true if this collector has errors.- Returns:
- true if the collector has errors.
-
-