Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.lang
Class ExceptionInInitializerError  view ExceptionInInitializerError download ExceptionInInitializerError.java

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Error
          extended byjava.lang.LinkageError
              extended byjava.lang.ExceptionInInitializerError
All Implemented Interfaces:
java.io.Serializable

public class ExceptionInInitializerError
extends LinkageError

An ExceptionInInitializerError is thrown when an uncaught exception has occurred in a static initializer or the initializer for a static variable. In general, this wraps only RuntimeExceptions, since the compiler does not allow a checked exception to be uncaught in an initializer. This exception only occurs during reflection, when a class is initialized as part of another action.

Since:
1.1

Nested Class Summary
 
Nested classes inherited from class java.lang.Throwable
 
Field Summary
private  Throwable exception
          The cause of this exception (duplicates the one stored in Throwable).
(package private) static long serialVersionUID
          Compatible with JDK 1.1+.
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
ExceptionInInitializerError()
          Create an error without a message.
ExceptionInInitializerError(String s)
          Create an error with a message.
ExceptionInInitializerError(Throwable t)
          Creates an error an saves a reference to the Throwable object.
 
Method Summary
 Throwable getCause()
          Return the exception that cause this error to be created.
 Throwable getException()
          Return the exception that caused this error to be created.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
Compatible with JDK 1.1+.

See Also:
Constant Field Values

exception

private final Throwable exception
The cause of this exception (duplicates the one stored in Throwable).

Constructor Detail

ExceptionInInitializerError

public ExceptionInInitializerError()
Create an error without a message. The cause is initialized as null.


ExceptionInInitializerError

public ExceptionInInitializerError(String s)
Create an error with a message. The cause is initialized as null.


ExceptionInInitializerError

public ExceptionInInitializerError(Throwable t)
Creates an error an saves a reference to the Throwable object. The message string is null.

Method Detail

getException

public Throwable getException()
Return the exception that caused this error to be created. This is a legacy method; the preferred choice now is Throwable.getCause() 55 .


getCause

public Throwable getCause()
Return the exception that cause this error to be created.

Overrides:
getCause in class Throwable
Since:
1.4