Skip to contentMethod: create(Collection)
      1: package de.fhdw.wtf.common.exception.referencer;
2: 
3: import java.util.Collection;
4: 
5: import de.fhdw.wtf.common.constants.referencer.ExceptionConstans;
6: import de.fhdw.wtf.common.exception.walker.TaskException;
7: 
8: /**
9:  * An exception to represent multiple exceptions that occur when resolving references to constructors.
10:  *
11:  */
12: public class ConstructorReferencerExceptions extends TaskException {
13:         
14:         /**
15:          * Exceptions.
16:          */
17:         private final Collection<TaskException> exceptions;
18:         
19:         /**
20:          * Creates a new {@link ConstructorReferencerExceptions} object.
21:          * 
22:          * @param exceptions
23:          *            the exceptions collected.
24:          * @return a new instance of {@link ConstructorReferencerExceptions}.
25:          */
26:         public static ConstructorReferencerExceptions create(final Collection<TaskException> exceptions) {
27:                 return new ConstructorReferencerExceptions(exceptions);
28:         }
29:         
30:         /**
31:          * COnstrucotr of {@link ConstructorReferencerExceptions}.
32:          * 
33:          * @param exceptions
34:          *            the exceptions collected.
35:          */
36:         public ConstructorReferencerExceptions(final Collection<TaskException> exceptions) {
37:                 super(ExceptionConstans.CONSTRUCTOR_REFERENCER_EXCEPTION_OCCURED);
38:                 this.exceptions = exceptions;
39:         }
40:         
41:         /**
42:          * Exceptions that are represented through this.
43:          * 
44:          * @return exceptions that are represented through this.
45:          */
46:         public Collection<TaskException> getExceptions() {
47:                 return this.exceptions;
48:         }
49:         
50: }