Package org.jvnet.hk2.internal
Class Collector
- java.lang.Object
-
- org.jvnet.hk2.internal.Collector
-
public class Collector extends java.lang.Object
This class collects errors, and can then also produce a MultiException from those errors if necessary
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.LinkedHashSet<java.lang.Throwable>
throwables
-
Constructor Summary
Constructors Constructor Description Collector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMultiException(MultiException me)
void
addThrowable(java.lang.Throwable th)
Adds a throwable to the list of throwables in this collectorboolean
hasErrors()
Returns true if this collector has errorsvoid
throwIfErrors()
This method will throw if the list of throwables associated with this collector is not empty
-
-
-
Method Detail
-
addMultiException
public void addMultiException(MultiException me)
-
addThrowable
public void addThrowable(java.lang.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 MultiException
This 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
-
-