author | chegar |
Thu, 17 Oct 2019 20:54:25 +0100 | |
branch | datagramsocketimpl-branch |
changeset 58679 | 9c3209ff7550 |
parent 58678 | 9cf78a70fa4f |
parent 58456 | 9759972b4f1c |
permissions | -rw-r--r-- |
2 | 1 |
/* |
58363
cf7c6f013d6d
8231546: Suppress warnings on non-serializable instance fields in java.prefs module
darcy
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package java.util.prefs; |
|
27 |
||
28 |
import java.io.NotSerializableException; |
|
29 |
||
30 |
/** |
|
32037
ab4526f4ac10
8133115: docs: replace <tt> tags (obsolete in html5) for java.util.logging, java.util.prefs, java.util.zip, java.util.jar
avstepan
parents:
25859
diff
changeset
|
31 |
* An event emitted by a {@code Preferences} node to indicate that |
2 | 32 |
* a child of that node has been added or removed.<p> |
33 |
* |
|
34 |
* Note, that although NodeChangeEvent inherits Serializable interface from |
|
35 |
* java.util.EventObject, it is not intended to be Serializable. Appropriate |
|
36 |
* serialization methods are implemented to throw NotSerializableException. |
|
37 |
* |
|
38 |
* @author Josh Bloch |
|
39 |
* @see Preferences |
|
40 |
* @see NodeChangeListener |
|
41 |
* @see PreferenceChangeEvent |
|
42 |
* @since 1.4 |
|
43 |
* @serial exclude |
|
44 |
*/ |
|
45 |
||
46 |
public class NodeChangeEvent extends java.util.EventObject { |
|
47 |
/** |
|
48 |
* The node that was added or removed. |
|
49 |
*/ |
|
58363
cf7c6f013d6d
8231546: Suppress warnings on non-serializable instance fields in java.prefs module
darcy
parents:
47216
diff
changeset
|
50 |
private transient Preferences child; |
2 | 51 |
|
52 |
/** |
|
32037
ab4526f4ac10
8133115: docs: replace <tt> tags (obsolete in html5) for java.util.logging, java.util.prefs, java.util.zip, java.util.jar
avstepan
parents:
25859
diff
changeset
|
53 |
* Constructs a new {@code NodeChangeEvent} instance. |
2 | 54 |
* |
55 |
* @param parent The parent of the node that was added or removed. |
|
56 |
* @param child The node that was added or removed. |
|
57 |
*/ |
|
58 |
public NodeChangeEvent(Preferences parent, Preferences child) { |
|
59 |
super(parent); |
|
60 |
this.child = child; |
|
61 |
} |
|
62 |
||
63 |
/** |
|
64 |
* Returns the parent of the node that was added or removed. |
|
65 |
* |
|
66 |
* @return The parent Preferences node whose child was added or removed |
|
67 |
*/ |
|
68 |
public Preferences getParent() { |
|
69 |
return (Preferences) getSource(); |
|
70 |
} |
|
71 |
||
72 |
/** |
|
73 |
* Returns the node that was added or removed. |
|
74 |
* |
|
75 |
* @return The node that was added or removed. |
|
76 |
*/ |
|
77 |
public Preferences getChild() { |
|
78 |
return child; |
|
79 |
} |
|
80 |
||
81 |
/** |
|
82 |
* Throws NotSerializableException, since NodeChangeEvent objects are not |
|
83 |
* intended to be serializable. |
|
84 |
*/ |
|
85 |
private void writeObject(java.io.ObjectOutputStream out) |
|
86 |
throws NotSerializableException { |
|
87 |
throw new NotSerializableException("Not serializable."); |
|
88 |
} |
|
89 |
||
90 |
/** |
|
91 |
* Throws NotSerializableException, since NodeChangeEvent objects are not |
|
92 |
* intended to be serializable. |
|
93 |
*/ |
|
94 |
private void readObject(java.io.ObjectInputStream in) |
|
95 |
throws NotSerializableException { |
|
96 |
throw new NotSerializableException("Not serializable."); |
|
97 |
} |
|
98 |
||
99 |
// Defined so that this class isn't flagged as a potential problem when |
|
100 |
// searches for missing serialVersionUID fields are done. |
|
101 |
private static final long serialVersionUID = 8068949086596572957L; |
|
102 |
} |