View Javadoc

1   /*
2    * JarInspector - Copyright (C) 2004 Che Inc., Rosario Argentina
3    *
4    * This program is free software; you can redistribute it and/or
5    * modify it under the terms of the GNU Library General Public
6    * License as published by the Free Software Foundation; either
7    * version 2 of the License, or (at your option) any later version.
8    *
9    * This library is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12   * Library General Public License for more details.
13   *
14   * You should have received a copy of the GNU Library General Public
15   * License along with this library; if not, write to the Free
16   * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17   */
18  
19  package inc.che.common.assertion;
20  
21  // Imports
22  
23  import org.apache.log4j.Logger;
24  
25  /***
26   *  <b>Errorklasse für Assert</b>
27   * @version $Id: AssertionException.java,v 1.1 2005/03/06 12:56:47 stevemcmee Exp $
28   * @author <address> Steve McMee &lt;stevemcmee@users.sourceforge.net&gt;</address>
29   */
30  
31  public class AssertionException extends RuntimeException {
32  
33      /*** CVS ID of this file */
34      public static final String CVS_ID =
35          "$Id: AssertionException.java,v 1.1 2005/03/06 12:56:47 stevemcmee Exp $";
36  
37      /***
38       * logger instance for this class
39       */
40  
41      private static Logger log = Logger.getLogger(AssertionException.class);
42  
43      private Throwable cause;
44      public AssertionException() {
45          if (log.isDebugEnabled()) {
46              log.debug("AssertionException()");
47          }
48      }
49      public AssertionException(String msg) {
50          super(msg);
51          if (log.isDebugEnabled()) {
52              log.debug("AssertionException(" + msg + ")");
53          }
54      }
55      public AssertionException(Throwable t) {
56          if (log.isDebugEnabled()) {
57              log.debug("AssertionException(" + t + ")");
58          }
59          cause = t;
60      }
61      public AssertionException(String msg, Throwable t) {
62          super(msg);
63          if (log.isDebugEnabled()) {
64              log.debug("AssertionException(" + msg + "," + t + ")");
65          }
66          cause = t;
67      }
68  
69      public Throwable getCause() {
70          return cause;
71      }
72  }