home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / InvalidClassException.java < prev    next >
Text File  |  1997-05-20  |  2KB  |  71 lines

  1. /*
  2.  * @(#)InvalidClassException.java    1.5 97/01/22
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  */
  21.  
  22. package java.io;
  23.  
  24. /**
  25.  * Raised when the Serialization runtime detects a problem with a Class.
  26.  * The class may: <UL>
  27.  * <LI> not match the serial version of the class in the stream
  28.  * <LI> the class contains unknown datatypes
  29.  * <LI> the class implements only one of writeObject or readObject methods
  30.  * <LI> the class is not public
  31.  * <LI> the class does not have an accessible no-arg constructor
  32.  * </UL>
  33.  *
  34.  * @author  unascribed
  35.  * @version 1.5, 01/22/97
  36.  * @since   JDK1.1
  37.  */
  38. public class InvalidClassException extends ObjectStreamException {
  39.     /**
  40.      * @since   JDK1.1
  41.      */
  42.     public String classname;
  43.  
  44.     /**
  45.      * Report a InvalidClassException for the specified reason.
  46.      * @since   JDK1.1
  47.      */
  48.     public InvalidClassException(String reason) {
  49.     super(reason);
  50.     }
  51.  
  52.     /**
  53.      * @since   JDK1.1
  54.      */
  55.     public InvalidClassException(String cname, String reason) {
  56.     super(reason);
  57.     classname = cname;
  58.     }
  59.  
  60.     /**
  61.      * Produce the message, include the classname if present.
  62.      * @since   JDK1.1
  63.      */
  64.     public String getMessage() {
  65.     if (classname == null) 
  66.         return super.getMessage();
  67.     else
  68.         return classname + "; " + super.getMessage();
  69.     }
  70. }
  71.