KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > barracuda > contrib > sam > data > DataObjectException


1 /*
2  * Copyright (C) 2003 Stefan Armbruster [stefan@armbruster-it.de]
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * $Id: DataObjectException.java,v 1.3 2004/02/01 05:16:27 christianc Exp $
19  */

20 package org.enhydra.barracuda.contrib.sam.data;
21
22 /** general exception class for all issues dealing with DataObjects
23 */

24 public class DataObjectException extends Exception JavaDoc
25 {
26
27     public static String JavaDoc DEFAULT_MESSAGE = null;
28
29     public DataObjectException()
30     {
31         super();
32     }
33
34     /* commented out due to a incompability to JDK 1.3 */
35     /*public DataObjectException(Throwable t)
36     {
37         super(t);
38     }*/

39
40     public DataObjectException(String JavaDoc s)
41     {
42         super(s);
43     }
44
45     /* commented out due to a incompability to JDK 1.3 */
46     /*public DataObjectException(String s, Throwable t)
47     {
48         super(s,t);
49     }*/

50
51     /** if the constructor was called with a non-null message, the default message is returned,
52     * otherwise the constructor's message.*/

53     public String JavaDoc getMessage() {
54         String JavaDoc s = super.getMessage();
55         if (s==null) {
56             s = getDefaultMessage();
57         }
58         return s;
59     }
60
61     protected String JavaDoc getDefaultMessage() {
62         return DEFAULT_MESSAGE;
63     }
64 }
65
66
Popular Tags