KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > util > type > TypeConversionException


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Header:$
17  */

18 package org.apache.beehive.netui.util.type;
19
20 /**
21  * A TypeConversionException is thrown when an error has occurred performing
22  * a type conversion in the {@link TypeUtils} class.
23  */

24 public class TypeConversionException
25     extends RuntimeException JavaDoc {
26
27     private String JavaDoc _localizedMessage = null;
28
29     /**
30      * Construct a TypeConversionException.
31      */

32     public TypeConversionException() {
33         super();
34     }
35
36     /**
37      * Construct a TypeConversionException.
38      *
39      * @param message message describing the error
40      */

41     public TypeConversionException(String JavaDoc message) {
42         super(message);
43     }
44
45     /**
46      * Construct a TypeConversionException.
47      *
48      * @param cause Throwable related to the cause of this exception
49      */

50     public TypeConversionException(Throwable JavaDoc cause) {
51         super(cause);
52     }
53
54     /**
55      * Construct a TypeConversionException.
56      *
57      * @param message message describing the error
58      * @param cause Throwable related to the cause of this exception
59      */

60     public TypeConversionException(String JavaDoc message, Throwable JavaDoc cause) {
61         super(message, cause);
62     }
63
64     /**
65      * Set a localized message describing the cause of this exception.
66      *
67      * @param localizedMessage a localized message
68      */

69     public void setLocalizedMessage(String JavaDoc localizedMessage) {
70         _localizedMessage = localizedMessage;
71     }
72
73     /**
74      * Get a localized message describing the cause of this exception.
75      *
76      * @return a localized message string
77      */

78     public String JavaDoc getLocalizedMessage() {
79         return (_localizedMessage != null ? _localizedMessage : getMessage());
80     }
81 }
82
Popular Tags