View Javadoc

1   /*
2    *  Copyright 2001-2004 The Apache Software Foundation
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
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.collections15.functors;
17  
18  import java.io.Serializable;
19  
20  
21  /***
22   * Runtime exception thrown from functors. If required, a root cause error can
23   * be wrapped within this one.
24   *
25   * @author Stephen Colebourne
26   * @version $Revision: 1.2 $ $Date: 2004/10/17 01:02:42 $
27   * @since Commons Collections15 1.0
28   */
29  public class FunctorException extends RuntimeException implements Serializable
30  {
31  
32      static final long serialVersionUID = 98091771022034397L;
33  
34      /***
35       * Constructs a new <code>FunctorException</code> without specified detail
36       * message.
37       */
38      public FunctorException()
39      {
40          super();
41      }
42  
43      /***
44       * Constructs a new <code>FunctorException</code> with specified detail
45       * message.
46       *
47       * @param msg the error message.
48       */
49      public FunctorException(String msg)
50      {
51          super(msg);
52      }
53  
54      /***
55       * Constructs a new <code>FunctorException</code> with specified nested
56       * <code>Throwable</code> root cause.
57       *
58       * @param rootCause the exception or error that caused this exception to be
59       *                  thrown.
60       */
61      public FunctorException(Throwable rootCause)
62      {
63          super(rootCause == null ? null : rootCause.getMessage(), rootCause);
64      }
65  
66      /***
67       * Constructs a new <code>FunctorException</code> with specified detail
68       * message and nested <code>Throwable</code> root cause.
69       *
70       * @param msg       the error message.
71       * @param rootCause the exception or error that caused this exception to be
72       *                  thrown.
73       */
74      public FunctorException(String msg, Throwable rootCause)
75      {
76          super(msg, rootCause);
77      }
78  }