01: package org.objectweb.celtix.common.i18n;
02:
03: public class Exception extends java.lang.Exception {
04:
05: private static final long serialVersionUID = 1L;
06:
07: private final Message message;
08:
09: public Exception(Message msg) {
10: message = msg;
11: }
12:
13: public Exception(Message msg, Throwable t) {
14: super (t);
15: message = msg;
16: }
17:
18: public Exception(Throwable cause) {
19: super (cause);
20: message = null;
21: }
22:
23: // the above constructors should be preferred to the following ones
24:
25: @Deprecated
26: public Exception() {
27: super ();
28: message = null;
29: }
30:
31: @Deprecated
32: public Exception(String msg) {
33: super (msg);
34: message = null;
35: }
36:
37: @Deprecated
38: public Exception(String msg, Throwable t) {
39: super (msg, t);
40: message = null;
41: }
42:
43: public String getCode() {
44: if (null != message) {
45: return message.getCode();
46: }
47: return null;
48: }
49:
50: public String getMessage() {
51: if (null != message) {
52: return message.toString();
53: }
54: return null;
55: }
56: }
|