< prev index next >

src/java.base/share/classes/java/io/InvalidClassException.java

Print this page

 20  *
 21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  * or visit www.oracle.com if you need additional information or have any
 23  * questions.
 24  */
 25 
 26 package java.io;
 27 
 28 /**
 29  * Thrown when the Serialization runtime detects one of the following
 30  * problems with a Class.
 31  * <UL>
 32  * <LI> The serial version of the class does not match that of the class
 33  *      descriptor read from the stream
 34  * <LI> The class contains unknown datatypes
 35  * <LI> The class does not have an accessible no-arg constructor
 36  * <LI> The ObjectStreamClass of an enum constant does not represent
 37  *      an enum type
 38  * <LI> Other conditions given in the <cite>Java Object Serialization
 39  *      Specification</cite>



 40  * </UL>
 41  *
 42  * @since   1.1
 43  */
 44 public class InvalidClassException extends ObjectStreamException {
 45 
 46     @java.io.Serial
 47     private static final long serialVersionUID = -4333316296251054416L;
 48 
 49     /**
 50      * Name of the invalid class.
 51      *
 52      * @serial Name of the invalid class.
 53      */
 54     public String classname;
 55 
 56     /**
 57      * Report an InvalidClassException for the reason specified.
 58      *
 59      * @param reason  String describing the reason for the exception.

 20  *
 21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  * or visit www.oracle.com if you need additional information or have any
 23  * questions.
 24  */
 25 
 26 package java.io;
 27 
 28 /**
 29  * Thrown when the Serialization runtime detects one of the following
 30  * problems with a Class.
 31  * <UL>
 32  * <LI> The serial version of the class does not match that of the class
 33  *      descriptor read from the stream
 34  * <LI> The class contains unknown datatypes
 35  * <LI> The class does not have an accessible no-arg constructor
 36  * <LI> The ObjectStreamClass of an enum constant does not represent
 37  *      an enum type
 38  * <LI> Other conditions given in the <cite>Java Object Serialization
 39  *      Specification</cite>
 40  * <LI> A {@linkplain Class#isValue()} value class implements {@linkplain Serializable}
 41  *      but does not delegate to a serialization proxy using {@code writeReplace()}.
 42  * <LI> A {@linkplain Class#isValue()} value class implements {@linkplain Externalizable}.
 43  * </UL>
 44  *
 45  * @since   1.1
 46  */
 47 public class InvalidClassException extends ObjectStreamException {
 48 
 49     @java.io.Serial
 50     private static final long serialVersionUID = -4333316296251054416L;
 51 
 52     /**
 53      * Name of the invalid class.
 54      *
 55      * @serial Name of the invalid class.
 56      */
 57     public String classname;
 58 
 59     /**
 60      * Report an InvalidClassException for the reason specified.
 61      *
 62      * @param reason  String describing the reason for the exception.
< prev index next >