java.io
Class InvalidClassException
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--java.io.IOException
|
+--java.io.ObjectStreamException
|
+--java.io.InvalidClassException
This exception is thrown when there is some sort of problem with a
class during a serialization operation. This could be:
- the serial version of the class doesn't match
- the class contains unknown datatypes
- the class does not have an accessible no-arg constructor
.
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:Author:- Aaron M. Renn (arenn@urbanophile.com)
classname
public String classname
The name of the class which encountered the error.
InvalidClassException
public InvalidClassException(java.lang.String message)
Create an exception with a descriptive error message, but a null
classname.
Parameters:
InvalidClassException
public InvalidClassException(java.lang.String classname, java.lang.String message)
Create an exception with a descriptive error message, and the name of
the class that caused the problem.
Parameters:
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()]
.
Returns:
- A descriptive error message, may be null
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.