KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > picocontainer > PicoVerificationException


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 JavaDoc;
13 import java.util.List JavaDoc;
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 JavaDoc nestedExceptions = new ArrayList JavaDoc();
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     public PicoVerificationException(final List JavaDoc nestedExceptions) {
40         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     public List JavaDoc getNestedExceptions() {
49         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     public String JavaDoc getMessage() {
60         return nestedExceptions.toString();
61     }
62 }
63
Popular Tags