home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / ExceptionInInitializerError.java < prev    next >
Text File  |  1997-05-20  |  2KB  |  74 lines

  1. /*
  2.  * @(#)ExceptionInInitializerError.java    1.2 97/01/20
  3.  *
  4.  * Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software
  7.  * and its documentation for NON-COMMERCIAL purposes and without
  8.  * fee is hereby granted provided that this copyright notice
  9.  * appears in all copies. Please refer to the file "copyright.html"
  10.  * for further important copyright and licensing information.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  13.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  14.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  15.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  16.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  17.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  18.  */
  19.  
  20. package java.lang;
  21.  
  22. /**
  23.  * Signals that an unexpected exception has occurred in a static initializer.
  24.  *
  25.  * @author  Frank Yellin
  26.  * @version 1.2, 01/20/97
  27.  *
  28.  * @since   JDK1.1
  29.  */
  30. public
  31. class ExceptionInInitializerError extends LinkageError {
  32.     private Throwable exception;
  33.  
  34.     /**
  35.      * Constructs an ExceptionInInitializerError with no detail message.
  36.      * A detail message is a String that describes this particular exception.
  37.      *
  38.      * @since   JDK1.1
  39.      */
  40.     public ExceptionInInitializerError() {
  41.     super();
  42.     }
  43.  
  44.     /**
  45.      * Constructs a new ExceptionInInitializerError class initialized to 
  46.      * the specific throwable
  47.      *
  48.      * @param thrown The exception thrown
  49.      * @since   JDK1.1
  50.      */
  51.     public ExceptionInInitializerError(Throwable thrown) {
  52.     this.exception = thrown;
  53.     }
  54.  
  55.     /**
  56.      * Constructs a ExceptionInInitializerError with the specified detail message.
  57.      * A detail message is a String that describes this particular exception.
  58.      *
  59.      * @param s the detail message
  60.      * @since   JDK1.1
  61.      */
  62.     public ExceptionInInitializerError(String s) {
  63.     super(s);
  64.     }
  65.  
  66.     /**
  67.      * Returns the exception that occurred during a static initialization that
  68.      * caused this Error to be created.
  69.      */
  70.     public Throwable getException() { 
  71.     return exception;
  72.     }
  73. }
  74.