FileDocCategorySizeDatePackage
InvalidClassException.javaAPI DocJava SE 5 API1593Fri Aug 26 14:57:00 BST 2005java.io

InvalidClassException

public class InvalidClassException extends ObjectStreamException
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
version
1.20, 12/19/03
since
JDK1.1

Fields Summary
public String
classname
Name of the invalid class.
Constructors Summary
public InvalidClassException(String reason)
Report a InvalidClassException for the reason specified.

param
reason String describing the reason for the exception.

	super(reason);
    
public InvalidClassException(String cname, String reason)
Constructs an InvalidClassException object.

param
cname a String naming the invalid class.
param
reason a String describing the reason for the exception.

	super(reason);
	classname = cname;
    
Methods Summary
public java.lang.StringgetMessage()
Produce the message and include the classname, if present.

	if (classname == null)
	    return super.getMessage();
	else
	    return classname + "; " + super.getMessage();