View Javadoc

1   /*
2    * $Id: TransformerException.java 7963 2007-08-21 08:53:15Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.umo.transformer;
12  
13  import org.mule.config.i18n.Message;
14  import org.mule.umo.endpoint.EndpointException;
15  
16  /**
17   * <code>TransformerException</code> is a simple exception that is thrown by
18   * transformers.
19   */
20  
21  public class TransformerException extends EndpointException
22  {
23      /**
24       * Serial version
25       */
26      private static final long serialVersionUID = 2943589828020763649L;
27  
28      private transient UMOTransformer transformer;
29  
30      /**
31       * @param message the exception message
32       */
33      public TransformerException(Message message, UMOTransformer transformer)
34      {
35          super(message);
36          this.transformer = transformer;
37          addInfo("Transformer", transformer.toString());
38      }
39  
40      /**
41       * @param message the exception message
42       * @param cause the exception that cause this exception to be thrown
43       */
44      public TransformerException(Message message, UMOTransformer transformer, Throwable cause)
45      {
46          super(message, cause);
47          this.transformer = transformer;
48          addInfo("Transformer", transformer.toString());
49      }
50  
51      public TransformerException(UMOTransformer transformer, Throwable cause)
52      {
53          super(cause);
54          this.transformer = transformer;
55          addInfo("Transformer", (transformer == null ? "null" : transformer.toString()));
56      }
57  
58      /**
59       * @param message the exception message
60       * @param cause the exception that cause this exception to be thrown
61       */
62      public TransformerException(Message message, Throwable cause)
63      {
64          super(message, cause);
65      }
66  
67      /**
68       * @param message the exception message
69       */
70      public TransformerException(Message message)
71      {
72          super(message);
73      }
74  
75      public UMOTransformer getTransformer()
76      {
77          return transformer;
78      }
79  }