KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > beans > BeanException


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.beans;
8
9
10 import com.inversoft.util.ReflectionException;
11
12
13 /**
14  * This class is the basic exception that gets thrown from
15  * the beans pacakge
16  *
17  * @author Brian Pontarelli
18  */

19 public class BeanException extends ReflectionException {
20     
21     /**
22      * Creates a new <tt>BeanException</tt> without detail message.
23      */

24     public BeanException() {
25     }
26
27
28     /**
29      * Constructs a <tt>BeanException</tt> with the specified detail message.
30      *
31      * @param msg The detail message.
32      */

33     public BeanException(String JavaDoc msg) {
34         super(msg);
35     }
36
37     /**
38      * Constructs a <tt>BeanException</tt> with the specified error message and
39      * also the specified root cause exception. The root cause exception is
40      * generally for TypeConversionException's root cause or something that
41      * might have caused a <tt>BeanException</tt>
42      *
43      * @param msg The detail message
44      * @param cause (Optional) The root cause exception to be wrapped
45      * inside this exception
46      */

47     public BeanException(String JavaDoc msg, Throwable JavaDoc cause) {
48         super(msg, cause);
49     }
50
51     /**
52      * Constructs a <tt>BeanException</tt> with the specified error message and
53      * also the specified root cause exception. The root cause exception is
54      * generally for TypeConversionException's root cause or something that
55      * might have caused a <tt>BeanException</tt>
56      *
57      * @param cause (Optional) The root cause exception to be wrapped
58      * inside this exception
59      */

60     public BeanException(Throwable JavaDoc cause) {
61         super(cause);
62     }
63
64     /**
65      * Constructs a <tt>BeanException</tt> with the specified error message,
66      * root cause exception and target exception. The root cause exception is
67      * generally for TypeConversionException's root cause or something that might
68      * have caused a <tt>BeanException</tt>. The target exception is an exception
69      * that was thrown from the getter or setter methods during reflection.
70      *
71      * @param msg The detail message
72      * @param cause (Optional) The root cause exception to be wrapped inside this exception
73      * @param target (Optional) The target exception to be wrapped inside this exception
74      */

75     public BeanException(String JavaDoc msg, Throwable JavaDoc cause, Throwable JavaDoc target) {
76         super(msg, cause, target);
77     }
78
79     /**
80      * This is a convience constructor that will create a new BeanException that
81      * is identical to the given ReflectionException, basically like a forced
82      * downcast constructor or a super-class copy constructor.
83      *
84      * @param re The ReflectionException to copy into this BeanException
85      */

86     public BeanException(ReflectionException re) {
87         super(re.getMessage(), re.getCause(), re.getTarget());
88     }
89 }
90
Popular Tags