01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.commons.beanutils;
19:
20: /**
21: * <p>A <strong>ConversionException</strong> indicates that a call to
22: * <code>Converter.convert()</code> has failed to complete successfully.
23: *
24: * @author Craig McClanahan
25: * @author Paulo Gaspar
26: * @since 1.3
27: */
28:
29: public class ConversionException extends RuntimeException {
30:
31: // ----------------------------------------------------------- Constructors
32:
33: /**
34: * Construct a new exception with the specified message.
35: *
36: * @param message The message describing this exception
37: */
38: public ConversionException(String message) {
39:
40: super (message);
41:
42: }
43:
44: /**
45: * Construct a new exception with the specified message and root cause.
46: *
47: * @param message The message describing this exception
48: * @param cause The root cause of this exception
49: */
50: public ConversionException(String message, Throwable cause) {
51:
52: super (message);
53: this .cause = cause;
54:
55: }
56:
57: /**
58: * Construct a new exception with the specified root cause.
59: *
60: * @param cause The root cause of this exception
61: */
62: public ConversionException(Throwable cause) {
63:
64: super (cause.getMessage());
65: this .cause = cause;
66:
67: }
68:
69: // ------------------------------------------------------------- Properties
70:
71: /**
72: * The root cause of this <code>ConversionException</code>, compatible with
73: * JDK 1.4's extensions to <code>java.lang.Throwable</code>.
74: */
75: protected Throwable cause = null;
76:
77: /**
78: * Return the root cause of this conversion exception.
79: * @return the root cause of this conversion exception
80: */
81: public Throwable getCause() {
82: return (this.cause);
83: }
84:
85: }
|