Android APIs
public class

InvalidClassException

extends ObjectStreamException
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.io.IOException
         ↳ java.io.ObjectStreamException
           ↳ java.io.InvalidClassException

Class Overview

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.

Summary

Fields
public String classname The fully qualified name of the class that caused the problem.
Public Constructors
InvalidClassException(String detailMessage)
Constructs a new InvalidClassException with its stack trace and detailed message filled in.
InvalidClassException(String className, String detailMessage)
Constructs a new InvalidClassException with its stack trace, detail message and the fully qualified name of the class which caused the exception filled in.
Public Methods
String getMessage()
Returns the detail message which was provided when the exception was created.
[Expand]
Inherited Methods
From class java.lang.Throwable
From class java.lang.Object

Fields

public String classname

Added in API level 1

The fully qualified name of the class that caused the problem.

Public Constructors

public InvalidClassException (String detailMessage)

Added in API level 1

Constructs a new InvalidClassException with its stack trace and detailed message filled in.

Parameters
detailMessage String: the detail message for this exception.

public InvalidClassException (String className, String detailMessage)

Added in API level 1

Constructs a new InvalidClassException with its stack trace, detail message and the fully qualified name of the class which caused the exception filled in.

Parameters
className String: the name of the class that caused the exception.
detailMessage String: the detail message for this exception.

Public Methods

public String getMessage ()

Added in API level 1

Returns the detail message which was provided when the exception was created. 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.

Returns
String the detail message, possibly concatenated with the name of the class that caused the problem.