|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
PicoVerificationException.java | - | 100% | 100% | 100% |
|
1 | /***************************************************************************** | |
2 | * Copyright (C) PicoContainer Organization. All rights reserved. * | |
3 | * ------------------------------------------------------------------------- * | |
4 | * The software in this package is published under the terms of the BSD * | |
5 | * style license a copy of which has been included with this distribution in * | |
6 | * the LICENSE.txt file. * | |
7 | * * | |
8 | * Original code by * | |
9 | *****************************************************************************/ | |
10 | package org.picocontainer; | |
11 | ||
12 | import java.util.ArrayList; | |
13 | import java.util.List; | |
14 | ||
15 | ||
16 | /** | |
17 | * Subclass of {@link PicoException} that is thrown when a {@link PicoContainer} hierarchy | |
18 | * cannot be verified. A failing verification is caused by ambuigities or missing dependencies | |
19 | * between the registered components and their parameters. This exception is designed as a | |
20 | * collector for all Exceptions occuring at the verification of the complete container | |
21 | * hierarchy. The verification is normally done with the | |
22 | * {@link org.picocontainer.defaults.VerifyingVisitor}, that will throw this exception. | |
23 | * | |
24 | * @version $Revision: 1801 $ | |
25 | * @since 1.0 | |
26 | */ | |
27 | public class PicoVerificationException | |
28 | extends PicoException { | |
29 | /** | |
30 | * The exceptions that caused this one. | |
31 | */ | |
32 | private final List nestedExceptions = new ArrayList(); | |
33 | ||
34 | /** | |
35 | * Construct a new exception with a list of exceptions that caused this one. | |
36 | * | |
37 | * @param nestedExceptions the exceptions that caused this one. | |
38 | */ | |
39 | 14 | public PicoVerificationException(final List nestedExceptions) { |
40 | 14 | this.nestedExceptions.addAll(nestedExceptions); |
41 | } | |
42 | ||
43 | /** | |
44 | * Retrieve the list of exceptions that caused this one. | |
45 | * | |
46 | * @return the list of exceptions that caused this one. | |
47 | */ | |
48 | 12 | public List getNestedExceptions() { |
49 | 12 | return nestedExceptions; |
50 | } | |
51 | ||
52 | /** | |
53 | * Return a string listing of all the messages associated with the exceptions that caused | |
54 | * this one. | |
55 | * | |
56 | * @return a string listing of all the messages associated with the exceptions that caused | |
57 | * this one. | |
58 | */ | |
59 | 24 | public String getMessage() { |
60 | 24 | return nestedExceptions.toString(); |
61 | } | |
62 | } |
|