KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thoughtworks > xstream > core > BaseException


1 package com.thoughtworks.xstream.core;
2
3 /**
4  * JDK1.3 friendly exception that retains cause.
5  */

6 public abstract class BaseException extends RuntimeException JavaDoc {
7
8     private Throwable JavaDoc cause;
9
10     protected BaseException(String JavaDoc message, Throwable JavaDoc cause) {
11         super(message + (cause == null ? "" : " : " + cause.getMessage()));
12         this.cause = cause;
13     }
14
15     protected BaseException(Throwable JavaDoc cause) {
16         this("", cause);
17     }
18
19     protected BaseException(String JavaDoc message) {
20         this(message, null);
21     }
22
23     protected BaseException() {
24         this("", null);
25     }
26
27     public Throwable JavaDoc getCause() {
28         return cause;
29     }
30     
31 }
32
Popular Tags