KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > generator > DODSGenerateException


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  */

19
20 /*
21  *
22  * @author Nenad Vico
23  * @version 1.0.0 2003/02/26
24  *
25  */

26 package org.enhydra.dods.generator;
27
28 public class DODSGenerateException extends Exception JavaDoc {
29
30     /**
31      * Construct a exception without a specified cause.
32      *
33      * @param msg The message associated with the exception.
34      */

35     public DODSGenerateException(String JavaDoc msg) {
36         super(msg);
37     }
38
39     /**
40      * Construct a exception with a specified cause.
41      *
42      * @param cause The error or exception that cause this
43      * exception.
44      */

45     public DODSGenerateException(Throwable JavaDoc cause) {
46         super(cause);
47     }
48
49     /**
50      * Construct a exception with an associated causing exception.
51      *
52      * @param msg The message associated with the exception.
53      * @param cause The error or exception that cause this
54      * exception.
55      */

56     public DODSGenerateException(String JavaDoc msg, Throwable JavaDoc cause) {
57         super(msg, cause);
58     }
59
60     /**
61      * Creates a localized description of this Exception.
62      *
63      * @return the localized description of this Exception.
64      */

65     public String JavaDoc getLocalizedMessage() {
66         String JavaDoc message = getMessage();
67         int index = message.lastIndexOf(": ");
68
69         if (index != -1) {
70             return message.substring(index + 1);
71         } else {
72             return getMessage();
73         }
74     }
75 }
76
Popular Tags