FileDocCategorySizeDatePackage
InvalidClassException.javaAPI DocJava SE 6 API1668Tue Jun 10 00:25:32 BST 2008java.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.24, 03/24/06
since
JDK1.1

Fields Summary
private static final long
serialVersionUID
public String
classname
Name of the invalid class.
Constructors Summary
public InvalidClassException(String reason)
Report an 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();