Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ConversionException |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2003-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 | package org.apache.commons.convert1; | |
17 | ||
18 | ||
19 | /** | |
20 | * <p>A <strong>ConversionException</strong> indicates that a call to | |
21 | * <code>Converter.convert()</code> has failed to complete successfully. | |
22 | * | |
23 | * @author Craig McClanahan | |
24 | * @author Paulo Gaspar | |
25 | * @since 0.1 | |
26 | */ | |
27 | ||
28 | public class ConversionException extends RuntimeException { | |
29 | ||
30 | ||
31 | // ----------------------------------------------------------- Constructors | |
32 | ||
33 | ||
34 | /** | |
35 | * Construct a new exception with the specified message. | |
36 | * | |
37 | * @param message The message describing this exception | |
38 | */ | |
39 | public ConversionException(String message) { | |
40 | ||
41 | 0 | super(message); |
42 | ||
43 | 0 | } |
44 | ||
45 | ||
46 | /** | |
47 | * Construct a new exception with the specified message and root cause. | |
48 | * | |
49 | * @param message The message describing this exception | |
50 | * @param cause The root cause of this exception | |
51 | */ | |
52 | public ConversionException(String message, Throwable cause) { | |
53 | ||
54 | 0 | super(message); |
55 | 0 | this.cause = cause; |
56 | ||
57 | 0 | } |
58 | ||
59 | ||
60 | /** | |
61 | * Construct a new exception with the specified root cause. | |
62 | * | |
63 | * @param cause The root cause of this exception | |
64 | */ | |
65 | public ConversionException(Throwable cause) { | |
66 | ||
67 | 0 | super(cause.getMessage()); |
68 | 0 | this.cause = cause; |
69 | ||
70 | 0 | } |
71 | ||
72 | ||
73 | // ------------------------------------------------------------- Properties | |
74 | ||
75 | ||
76 | /** | |
77 | * The root cause of this <code>ConversionException</code>, compatible with | |
78 | * JDK 1.4's extensions to <code>java.lang.Throwable</code>. | |
79 | */ | |
80 | 0 | protected Throwable cause = null; |
81 | ||
82 | public Throwable getCause() { | |
83 | 0 | return (this.cause); |
84 | } | |
85 | ||
86 | ||
87 | } |