01: /*
02: * Copyright 2005-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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 net.sf.dozer.util.mapping;
17:
18: /**
19: * Runtime exception thrown by Dozer. RuntimeExceptions thrown from custom code called by Dozer during mapping (eg.
20: * custom converters) are not wrapped with MappingException.
21: *
22: * @author garsombke.franz
23: * @author sullins.ben
24: * @author tierney.matt
25: *
26: */
27: public class MappingException extends RuntimeException {
28: private Throwable cause;
29:
30: public MappingException(String arg0) {
31: super (arg0);
32: }
33:
34: public MappingException(String arg0, Throwable cause) {
35: // For JDK 1.3 RuntimeException - it does not support a Throwable in the constructor
36: super (arg0);
37: this .cause = cause;
38: }
39:
40: public MappingException(Throwable cause) {
41: // For JDK 1.3 RuntimeException - it does not support a Throwable in the constructor
42: super (cause.toString());
43: this .cause = cause;
44: }
45:
46: public Throwable getCause() {
47: return cause;
48: }
49: }
|