1 /* InvalidClassException.java -- An I/O operation was interrupted.
2 Copyright (C) 1998 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 As a special exception, if you link this library with other files to
22 produce an executable, this library does not by itself cause the
23 resulting executable to be covered by the GNU General Public License.
24 This exception does not however invalidate any other reasons why the
25 executable file might be covered by the GNU General Public License. */
31 * This exception is thrown when there is some sort of problem with a
32 * class during a serialization operation. This could be that the
33 * versions don't match, that there are unknown datatypes in the class
34 * or that the class doesn't have a default no-arg constructor.
36 * The field <code>classname</code> will contain the name of the
37 * class that caused the problem if known. The getMessage() method
38 * for this exception will always include the name of that class
43 * @author Aaron M. Renn (arenn@urbanophile.com)
45 public class InvalidClassException extends ObjectStreamException
53 * The name of the class which encountered the error.
55 public String classname;
57 /*************************************************************************/
64 * Create a new InvalidClassException with a descriptive error message String
66 * @param message The descriptive error message
69 InvalidClassException(String message)
74 /*************************************************************************/
77 * Create a new InvalidClassException with a descriptive error message
78 * String, and the name of the class that caused the problem.
80 * @param classname The number of bytes tranferred before the interruption
81 * @param message The descriptive error message
84 InvalidClassException(String classname, String message)
87 this.classname = classname;
90 /*************************************************************************/
97 * Returns the descriptive error message for this exception. It will
98 * include the class name that caused the problem if known. This method
99 * overrides Throwable.getMessage()
101 * @return A descriptive error message
106 return(super.getMessage() + ": " + classname);
109 } // class InvalidClassException