Source code: openfuture/bugbase/error/BugBaseException.java
1 package openfuture.bugbase.error;
2 /*
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2 of the License, or (at your option) any later version.<p>
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.<p>
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA<br>
16 * http://www.gnu.org/copyleft/lesser.html
17 */
18
19 // Configuration Management Information:
20 // -------------------------------------
21 // $Id: BugBaseException.java,v 1.3 2001/07/01 06:46:30 wreissen Exp $
22 //
23 // Version History:
24 // ----------------
25 // $Log: BugBaseException.java,v $
26 // Revision 1.3 2001/07/01 06:46:30 wreissen
27 // fixed errors in DOS/Unix-translation.
28 //
29 // Revision 1.1 2000/09/27 15:53:24 wreissen
30 // moved to openfuture.
31 //
32 // Revision 1.2 2000/08/28 10:25:47 wreissen
33 // bug fix: reason and result where set by the constructor.
34 //
35 // Revision 1.1 2000/07/10 05:21:07 wreissen
36 // initial version
37 //
38 //
39 // ***********************************************************************************
40 /**
41 * Exception containing the (internationalizable) description of the
42 * reason why this exception occured and the resulting situation.
43 *
44 *
45 * Created: Wed Jul 05 23:07:29 2000
46 *
47 * @author Wolfgang Reissenberger
48 * @version $Revision: 1.3 $
49 */
50
51 public class BugBaseException extends Exception {
52
53 private String reasonKey;
54 private String reason;
55 private String resultKey;
56 private String result;
57
58
59 /**
60 * Create a new instance.
61 *
62 * @param reasonKey key of the reason
63 * @param reason reason description in the default language
64 * @param resultKey key of the result
65 * @param result description of the resulting situation int
66 * the default language
67 */
68 public BugBaseException(String reasonKey, String reason,
69 String resultKey, String result) {
70 super(result + " Reason: " + reason);
71 setReasonKey(reasonKey);
72 setResultKey(resultKey);
73 setReason(reason);
74 setResult(result);
75 }
76
77
78 /**
79 * Get the value of reasonKey.
80 * @return Value of reasonKey.
81 */
82 public String getReasonKey() {return reasonKey;}
83
84 /**
85 * Set the value of reasonKey.
86 * @param v Value to assign to reasonKey.
87 */
88 public void setReasonKey(String v) {
89 this.reasonKey = v;
90 }
91
92
93 /**
94 * Get the value of reason.
95 * @return Value of reason.
96 */
97 public String getReason() {return reason;}
98
99 /**
100 * Set the value of reason.
101 * @param v Value to assign to reason.
102 */
103 public void setReason(String v) {
104 this.reason = v;
105 }
106
107
108
109 /**
110 * Get the value of resultKey.
111 * @return Value of resultKey.
112 */
113 public String getResultKey() {return resultKey;}
114
115 /**
116 * Set the value of resultKey.
117 * @param v Value to assign to resultKey.
118 */
119 public void setResultKey(String v) {
120 this.resultKey = v;
121 }
122
123
124 /**
125 * Get the value of result.
126 * @return Value of result.
127 */
128 public String getResult() {return result;}
129
130 /**
131 * Set the value of result.
132 * @param v Value to assign to result.
133 */
134 public void setResult(String v) {
135 this.result = v;
136 }
137
138
139 /**
140 * Overrides the method of the superclass. Reports resulting
141 * situation and its reason.
142 *
143 * @return a value of type 'String'
144 */
145 public String getMessage() {
146 return (getResult() + " Reason: " + getReason());
147 }
148 } // BugBaseException
149
150
151
152
153
154