home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 1.5 KB | 58 lines |
- /*
- * @(#)InvalidClassException.java 1.9 98/03/18
- *
- * Copyright 1996, 1997 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-
- package java.io;
-
- /**
- * Raised when the Serialization runtime detects a problem with a Class.
- * The class may: <UL>
- * <LI> not match the serial version of the class in the stream
- * <LI> the class contains unknown datatypes
- * <LI> the class does not have an accessible no-arg constructor
- * </UL>
- *
- * @author unascribed
- * @version 1.9, 03/18/98
- * @since JDK1.1
- */
- public class InvalidClassException extends ObjectStreamException {
- /**
- */
- public String classname;
-
- /**
- * Report a InvalidClassException for the specified reason.
- */
- public InvalidClassException(String reason) {
- super(reason);
- }
-
- /**
- */
- public InvalidClassException(String cname, String reason) {
- super(reason);
- classname = cname;
- }
-
- /**
- * Produce the message, include the classname if present.
- */
- public String getMessage() {
- if (classname == null)
- return super.getMessage();
- else
- return classname + "; " + super.getMessage();
- }
- }
-