ExceptionInInitializerError is thrown to indicate that an
exception occurred during evaluation of a static initializer or the
initializer for a static variable.
| Modifier and Type | Field and Description |
|---|---|
| private static final ObjectStreamField[] | serialPersistentFields
Serializable fields for ExceptionInInitializerError. |
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.1.X for interoperability
|
| Access | Constructor and Description |
|---|---|
| public | ExceptionInInitializerError()
Constructs an |
| public | ExceptionInInitializerError(Throwable
The exception thrown thrown)Constructs a new |
| public | ExceptionInInitializerError(String
the detail message s)Constructs an |
| Modifier and Type | Method and Description |
|---|---|
| public Throwable | Returns: the saved throwable object of thisExceptionInInitializerError, or null
if this ExceptionInInitializerError has no saved
throwable object.Returns the exception that occurred during a static initialization that caused this error to be created. |
| private void | readObject(ObjectInputStream
the s)ObjectInputStream from which data is readHides java. Reconstitutes the ExceptionInInitializerError instance from a stream and initialize the cause properly when deserializing from an older version. |
| private void | writeObject(ObjectOutputStream
the out)ObjectOutputStream to which data is writtenHides java. To maintain compatibility with older implementation, write a serial "exception" field with the cause as the value. |
| serialPersistentFields | back to summary |
|---|---|
| private static final ObjectStreamField[] serialPersistentFields Serializable fields for ExceptionInInitializerError.
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Use serialVersionUID from JDK 1.1.X for interoperability | |
| ExceptionInInitializerError | back to summary |
|---|---|
| public ExceptionInInitializerError() Constructs an
| |
| ExceptionInInitializerError | back to summary |
|---|---|
| public ExceptionInInitializerError(Throwable thrown) Constructs a new
| |
| ExceptionInInitializerError | back to summary |
|---|---|
| public ExceptionInInitializerError(String s) Constructs an
| |
| getException | back to summary |
|---|---|
| public Throwable getException() Returns the exception that occurred during a static initialization that caused this error to be created. API Note This method predates the general-purpose exception chaining facility.
The
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException Hides java. Reconstitutes the ExceptionInInitializerError instance from a stream and initialize the cause properly when deserializing from an older version. The getException and getCause method returns the private "exception" field in the older implementation and ExceptionInInitializerError::cause was set to null.
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream out) throws IOException Hides java. To maintain compatibility with older implementation, write a serial "exception" field with the cause as the value.
| |