InvalidClassExceptionpublic class InvalidClassException extends ObjectStreamException Signals a problem during the serialization or or deserialization of an
object. Possible reasons include:
- The SUIDs of the class loaded by the VM and the serialized class info do
not match.
- A serializable or externalizable object cannot be instantiated (when
deserializing) because the no-arg constructor that needs to be run is not
visible or fails.
|
Fields Summary |
---|
private static final long | serialVersionUID | public String | classnameThe fully qualified name of the class that caused the problem. |
Constructors Summary |
---|
public InvalidClassException(String detailMessage)Constructs a new {@code InvalidClassException} with its stack trace and
detailed message filled in.
super(detailMessage);
| public InvalidClassException(String className, String detailMessage)Constructs a new {@code InvalidClassException} with its stack trace,
detail message and the fully qualified name of the class which caused the
exception filled in.
super(detailMessage);
this.classname = className;
|
Methods Summary |
---|
public java.lang.String | getMessage()Returns the detail message which was provided when the exception was
created. {@code null} is returned if no message was provided at creation
time. If a detail message as well as a class name are provided, then the
values are concatenated and returned.
String msg = super.getMessage();
if (classname != null) {
msg = classname + "; " + msg; //$NON-NLS-1$
}
return msg;
|
|