1 |
/* InvalidPreferenceFormatException - Indicates reading prefs from stream failed |
/* InvalidPreferencesFormatException - indicates reading prefs from stream |
2 |
Copyright (C) 2001 Free Software Foundation, Inc. |
failed |
3 |
|
Copyright (C) 2001, 2002 Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
6 |
|
|
8 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
9 |
the Free Software Foundation; either version 2, or (at your option) |
the Free Software Foundation; either version 2, or (at your option) |
10 |
any later version. |
any later version. |
11 |
|
|
12 |
GNU Classpath is distributed in the hope that it will be useful, but |
GNU Classpath is distributed in the hope that it will be useful, but |
13 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
38 |
|
|
39 |
package java.util.prefs; |
package java.util.prefs; |
40 |
|
|
41 |
|
import java.io.ObjectOutputStream; |
42 |
|
import java.io.ObjectInputStream; |
43 |
|
import java.io.NotSerializableException; |
44 |
|
|
45 |
/** |
/** |
46 |
* Indicates reading prefs from stream failed. Thrown by the |
* Indicates reading prefs from stream failed. Thrown by the |
47 |
* <code>importPreferences()</code> method when the supplied input stream |
* <code>importPreferences()</code> method when the supplied input stream |
48 |
* could not be read because it was not in the correct XML format. |
* could not be read because it was not in the correct XML format. |
49 |
* |
* |
50 |
|
* <p>Note that although this class inherits the Serializable interface, an |
51 |
|
* attempt to serialize will fail with a <code>NotSerializableException</code>. |
52 |
|
* |
53 |
|
* @author Mark Wielaard <mark@klomp.org> |
54 |
|
* @see Preferences |
55 |
* @since 1.4 |
* @since 1.4 |
56 |
* @author Mark Wielaard (mark@klomp.org) |
* @status updated to 1.4 |
57 |
*/ |
*/ |
58 |
public class InvalidPreferencesFormatException extends Exception { |
public class InvalidPreferencesFormatException extends Exception |
59 |
|
{ |
60 |
/** |
/** |
61 |
* Creates a new exception with a descriptive message. |
* Creates a new exception with a descriptive message. The cause remains |
62 |
*/ |
* uninitialized. |
63 |
public InvalidPreferencesFormatException(String message) { |
* |
64 |
super(message); |
* @param message the message |
65 |
} |
*/ |
66 |
|
public InvalidPreferencesFormatException(String message) |
67 |
/** |
{ |
68 |
* Creates a new exception with the given cause. |
super(message); |
69 |
*/ |
} |
70 |
public InvalidPreferencesFormatException(Throwable cause) { |
|
71 |
// XXX - Use when we have 1.4 Throwable support |
/** |
72 |
// super(cause); |
* Creates a new exception with the given cause. |
73 |
super(); |
* |
74 |
} |
* @param cause the cause |
75 |
|
*/ |
76 |
/** |
public InvalidPreferencesFormatException(Throwable cause) |
77 |
* Creates a new exception with a descriptive message and a cause. |
{ |
78 |
*/ |
super(cause); |
79 |
public InvalidPreferencesFormatException(String message, Throwable cause) { |
} |
80 |
// XXX - Use when we have 1.4 Throwable support |
|
81 |
// super(message, cause); |
/** |
82 |
super(message); |
* Creates a new exception with a descriptive message and a cause. |
83 |
} |
* |
84 |
|
* @param message the message |
85 |
|
* @param cause the cause |
86 |
|
*/ |
87 |
|
public InvalidPreferencesFormatException(String message, Throwable cause) |
88 |
|
{ |
89 |
|
super(message, cause); |
90 |
|
super(message); |
91 |
|
} |
92 |
|
|
93 |
|
/** |
94 |
|
* This class should not be serialized. |
95 |
|
* |
96 |
|
* @param o the output stream |
97 |
|
*/ |
98 |
|
private void writeObject(ObjectOutputStream o) |
99 |
|
{ |
100 |
|
throw new NotSerializableException |
101 |
|
("java.util.prefs.InvalidPreferencesFormatException"); |
102 |
|
} |
103 |
|
|
104 |
|
/** |
105 |
|
* This class should not be serialized. |
106 |
|
* |
107 |
|
* @param i the input stream |
108 |
|
*/ |
109 |
|
private void readObject(ObjectInputStream i) |
110 |
|
{ |
111 |
|
throw new NotSerializableException |
112 |
|
("java.util.prefs.InvalidPreferencesFormatException"); |
113 |
|
} |
114 |
} |
} |