Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/aendvari/cerberus/component/assembly/AssemblyException.java


1   /*
2    * AssemblyException.java
3    *
4    * Copyright (c) 2001, 2002 Aendvari, Ltd. All Rights Reserved.
5    *
6    * See the file LICENSE for terms of use.
7    *
8    */
9   
10  package com.aendvari.cerberus.component.assembly;
11  
12  /**
13   * <p>Describes an a problem that occured during component assembly.</p>
14   *
15   * @author  Trevor Milne
16   *
17   */
18  
19  public class AssemblyException extends Exception
20  {
21    /** The exception that caused this exception, may be null. */
22    protected Throwable rootCause;
23  
24  
25    /* Constructors */
26  
27  
28    /**
29     * Constructs a <code>AssemblyException</code> with no detail message.
30     *
31     */
32  
33    public AssemblyException()
34    {
35      super();
36  
37      rootCause = null;
38    }
39  
40    /**
41     * Constructs a <code>AssemblyException</code> with causing exception.
42     *
43     * @param    setRootCause        The exception causing this exception.
44     *
45     */
46  
47    public AssemblyException(Throwable setRootCause)
48    {
49      rootCause = setRootCause;
50    }
51  
52    /**
53     * Constructs a <code>AssemblyException</code> with the supplied detail message.
54     *
55     * @param    setMessage          String describing error.
56     *
57     */
58  
59    public AssemblyException(String setMessage)
60    {
61      super(setMessage);
62    }
63  
64    /**
65     * Constructs a <code>AssemblyException</code> with the supplied detail message
66     * and causing exception.
67     *
68     * @param    setMessage          String describing error.
69     * @param    setRootCause        The exception causing this exception.
70     *
71     */
72  
73    public AssemblyException(String message, Throwable setRootCause)
74    {
75      super(message);
76  
77      rootCause = setRootCause;
78    }
79  
80  
81    /* Accessors. */
82  
83  
84    /**
85     * Returns the exception that caused this exception, null if none.
86     *
87     */
88  
89    public Throwable getRootCause()
90    {
91      return rootCause;
92    }
93  
94    /**
95     * Returns a string representation of the exception.
96     *
97     */
98  
99    public String toString()
100   {
101     return (super.toString() + "; cause=" + rootCause);
102   }
103 }
104