KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ejb > genic > GenICException


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999-2004 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: GenICException.java,v 1.5 2004/09/17 08:40:04 joaninh Exp $
23  * --------------------------------------------------------------------------
24  */

25
26
27 package org.objectweb.jonas_ejb.genic;
28
29 /**
30  * This class represents the exception that can be throwned by the GenIC tool.
31  *
32  * @author Helene Joanin : Initial developer
33  */

34 public class GenICException extends Exception JavaDoc {
35
36     protected Exception JavaDoc inner = null;
37
38     /**
39      * Constructs an GenICException with no specified detail message.
40      */

41     public GenICException() {
42         super();
43     }
44
45     /**
46      * Constructs an GenICException with the specified detail message.
47      */

48     public GenICException(String JavaDoc msg) {
49         super(msg);
50     }
51
52     public GenICException(String JavaDoc msg, Exception JavaDoc inner) {
53         super(msg);
54         this.inner = inner;
55
56     }
57
58     public String JavaDoc toString() {
59         String JavaDoc s = GenICException.class.getName() + ": " + super.getMessage();
60         if (inner == null) {
61             return (s);
62         } else {
63             return (s + " (" + inner.toString() + ")");
64         }
65     }
66
67     public String JavaDoc getMessage() {
68         String JavaDoc s = super.getMessage();
69         if (inner == null) {
70             return (s);
71         } else {
72             return (s + " (" + inner.getMessage() + ")");
73         }
74     }
75
76     public void printStackTrace() {
77         System.out.println(getMessage());
78         if (inner != null) {
79             inner.printStackTrace();
80         }
81     }
82     public void printStackTrace(java.io.PrintStream JavaDoc s) {
83         s.println(getMessage());
84         if (inner != null) {
85             inner.printStackTrace(s);
86         }
87     }
88     public void printStackTrace(java.io.PrintWriter JavaDoc s) {
89         s.println(getMessage());
90         if (inner != null) {
91             inner.printStackTrace(s);
92         }
93     }
94 }
95
Popular Tags