1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.morph.transform;
17
18 import net.sf.composite.util.ObjectUtils;
19 import net.sf.morph.MorphException;
20
21 /**
22 * @author Matt Sgarlata
23 * @since Nov 26, 2004
24 */
25 public class TransformationException extends MorphException {
26
27 public TransformationException() {
28 super();
29 }
30 public TransformationException(String message) {
31 super(message);
32 }
33 public TransformationException(String message, Throwable cause) {
34 super(message, cause);
35 }
36 public TransformationException(Throwable cause) {
37 super(cause);
38 }
39 public TransformationException(Class destinationClass, Object source) {
40 this(destinationClass, source, null, null);
41 }
42 public TransformationException(Class destinationClass, Object source,
43 Throwable t) {
44 this(destinationClass, source, t, null);
45 }
46 public TransformationException(Class destinationClass, Object source,
47 Throwable t, String message) {
48 super("Unable to convert " + ObjectUtils.getObjectDescription(source)
49 + " to " + destinationClass
50 + (ObjectUtils.isEmpty(message) ? "" : " because " + message),
51 t);
52 }
53
54 public TransformationException(Object destination, Object source, Throwable t) {
55 super("Unable to copy from " + ObjectUtils.getObjectDescription(source)
56 + " to " + ObjectUtils.getObjectDescription(destination), t);
57 }
58
59 public TransformationException(Object destination, Object source) {
60 this(destination, source, null);
61 }
62
63 }