java.io
public class: InvalidClassException [javadoc |
source]
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
java.io.ObjectStreamException
java.io.InvalidClassException
All Implemented Interfaces:
Serializable
Thrown when the Serialization runtime detects one of the following
problems with a Class.
- The serial version of the class does not match that of the class
descriptor read from the stream
- The class contains unknown datatypes
- The class does not have an accessible no-arg constructor
- author:
unascribed
-
- since:
JDK1.1
-
Field Summary |
---|
public String | classname | Name of the invalid class.- serial:
Name - of the invalid class.
|
Constructor: |
public InvalidClassException(String reason) {
super(reason);
}
Report an InvalidClassException for the reason specified. Parameters:
reason - String describing the reason for the exception.
|
public InvalidClassException(String cname,
String reason) {
super(reason);
classname = cname;
}
Constructs an InvalidClassException object. Parameters:
cname - a String naming the invalid class.
reason - a String describing the reason for the exception.
|
Method from java.io.InvalidClassException Summary: |
---|
getMessage |
Methods from java.lang.Throwable: |
---|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getStackTraceDepth, getStackTraceElement, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from java.io.InvalidClassException Detail: |
public String getMessage() {
if (classname == null)
return super.getMessage();
else
return classname + "; " + super.getMessage();
}
Produce the message and include the classname, if present. |