home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / io / InvalidClassException.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  1.6 KB  |  61 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)InvalidClassException.java    1.13 98/06/29
  3.  *
  4.  * Copyright 1996-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.io;
  16.  
  17. /**
  18.  * Thrown when the Serialization runtime detects one of the following
  19.  * problems with a Class.
  20.  * <UL>
  21.  * <LI> The serial version of the class does not match that of the class
  22.  *      descriptor read from the stream
  23.  * <LI> The class contains unknown datatypes
  24.  * <LI> The class does not have an accessible no-arg constructor
  25.  * </UL>
  26.  *
  27.  * @author  unascribed
  28.  * @version 1.13, 06/29/98
  29.  * @since   JDK1.1
  30.  */
  31. public class InvalidClassException extends ObjectStreamException {
  32.     /**
  33.      * @serial Name of the invalid class.
  34.      */
  35.     public String classname;
  36.  
  37.     /**
  38.      * Report a InvalidClassException for the reason specified.
  39.      */
  40.     public InvalidClassException(String reason) {
  41.     super(reason);
  42.     }
  43.  
  44.     /**
  45.      */
  46.     public InvalidClassException(String cname, String reason) {
  47.     super(reason);
  48.     classname = cname;
  49.     }
  50.  
  51.     /**
  52.      * Produce the message and include the classname, if present.
  53.      */
  54.     public String getMessage() {
  55.     if (classname == null)
  56.         return super.getMessage();
  57.     else
  58.         return classname + "; " + super.getMessage();
  59.     }
  60. }
  61.