java.io
Class InvalidClassException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by java.io.ObjectStreamException
                  extended by java.io.InvalidClassException
All Implemented Interfaces:
Serializable

public class InvalidClassException
extends ObjectStreamException

This exception is thrown when there is some sort of problem with a class during a serialization operation. This could be:

.

The field classname will contain the name of the class that caused the problem if known. The getMessage() method for this exception will always include the name of that class if known.

Since:
1.1
See Also:
Serialized Form

Field Summary
 String classname
          The name of the class which encountered the error.
 
Constructor Summary
InvalidClassException(String message)
          Create an exception with a descriptive error message, but a null classname.
InvalidClassException(String classname, String message)
          Create an exception with a descriptive error message, and the name of the class that caused the problem.
 
Method Summary
 String getMessage()
          Returns the descriptive error message for this exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

classname

public String classname
The name of the class which encountered the error.

Constructor Detail

InvalidClassException

public InvalidClassException(String message)
Create an exception with a descriptive error message, but a null classname.

Parameters:
message - the descriptive error message

InvalidClassException

public InvalidClassException(String classname,
                             String message)
Create an exception with a descriptive error message, and the name of the class that caused the problem.

Parameters:
classname - the name of the faulty class
message - the descriptive error message
Method Detail

getMessage

public String getMessage()
Returns the descriptive error message for this exception. It will include the class name that caused the problem if known, in the format: [classname][; ][super.getMessage()].

Overrides:
getMessage in class Throwable
Returns:
A descriptive error message, may be null