KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > sync > ldap > ConfigException


1 package de.webman.sync.ldap;
2
3 import java.io.PrintStream JavaDoc;
4 import java.io.PrintWriter JavaDoc;
5
6
7 /**
8  * This excpetion is thrown for bad ldap gate configurations.
9  *
10  * @author <a HREF="mailto:gregor@webman.de">Gregor Klinke</a>
11  * @version $Revision: 1.2 $
12  **/

13 public class ConfigException
14     extends Exception JavaDoc
15 {
16     /* $Id: ConfigException.java,v 1.2 2002/04/12 14:56:02 gregor Exp $ */
17
18     /**
19      * The cause for this exception.
20      */

21     private Exception JavaDoc cause = null;
22
23     /**
24      * constructor
25      **/

26     public ConfigException () {
27     }
28
29     public ConfigException (String JavaDoc s) {
30         super(s);
31     }
32     
33     public ConfigException (Exception JavaDoc _cause) {
34         cause = _cause;
35     }
36     
37     
38     /**
39      * Returns the error message of this exception.
40      *
41      * @return the error message of this exception.
42      */

43     public String JavaDoc getMessage () {
44         return (cause == null
45                 ? super.getMessage()
46                 : cause.getMessage());
47     }
48     
49     /**
50      * Returns the localized description of this exception.
51      *
52      * @return the localized description of this exception.
53      */

54     public String JavaDoc getLocalizedMessage () {
55         return (cause == null
56                 ? super.getLocalizedMessage()
57                 : cause.getLocalizedMessage());
58     }
59     
60     /**
61      * Returns the short description of this exception.
62      *
63      * @return the short description of this exception.
64      */

65     public String JavaDoc toString ()
66     {
67         return (cause == null
68                 ? super.toString()
69                 : cause.toString());
70     }
71     
72     /**
73      * Prints this exception and its backtrace to the
74      * standard error stream.
75      */

76     public void printStackTrace ()
77     {
78         if (cause == null) {
79             super.printStackTrace();
80         }
81         else {
82             printStackTrace();
83         }
84     }
85     
86     /**
87      * Prints this exception and its backtrace to the
88      * given print stream.
89      *
90      * @param ps the print stream.
91      */

92     public void printStackTrace (PrintStream JavaDoc ps)
93     {
94         if (cause == null) {
95             super.printStackTrace(ps);
96         }
97         else {
98             cause.printStackTrace(ps);
99         }
100     }
101
102     /**
103      * Prints this exception and its backtrace to the
104      * given print writer.
105      *
106      * @param ps the print writer.
107      */

108     public void printStackTrace (PrintWriter JavaDoc pw)
109     {
110         if (cause == null) {
111             super.printStackTrace(pw);
112         }
113         else {
114             cause.printStackTrace(pw);
115         }
116     }
117 }
118
Popular Tags