01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: ConversionException.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.tools.exceptions;
09:
10: public class ConversionException extends Exception {
11: private static final long serialVersionUID = 8951249584169075072L;
12:
13: private Object mFrom;
14: private Class mTo;
15:
16: public ConversionException(Object from, Class to, Throwable cause) {
17: super (
18: "Impossible to convert "
19: + from
20: + " from "
21: + (null == from ? "unknown" : from.getClass()
22: .getName()) + " to " + to.getName(),
23: cause);
24: mFrom = from;
25: mTo = to;
26: }
27:
28: public Object getFrom() {
29: return mFrom;
30: }
31:
32: public Class getTo() {
33: return mTo;
34: }
35: }
|