mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
36 lines
1.3 KiB
HTML
36 lines
1.3 KiB
HTML
<html>
|
|
<body>
|
|
Reports serialization methods or fields defined in a <code>record</code> class.
|
|
Serialization methods include <code>writeObject()</code>, <code>readObject()</code>, <code>readObjectNoData()</code>, <code>writeExternal()</code>, and
|
|
<code>readExternal()</code> and the field <code>serialPersistentFields</code>.
|
|
These members are not used for the serialization or deserialization of records and therefore unnecessary.
|
|
<p><b>Examples:</b></p>
|
|
<pre><code>
|
|
record R1() implements Serializable {
|
|
// The field is ignored during record serialization
|
|
@Serial
|
|
private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0];
|
|
|
|
// The method is ignored during record serialization
|
|
@Serial
|
|
private void writeObject(ObjectOutputStream out) throws IOException {
|
|
}
|
|
}
|
|
</code></pre>
|
|
<pre><code>
|
|
record R2() implements Externalizable {
|
|
// The method is ignored during record serialization
|
|
@Override
|
|
public void writeExternal(ObjectOutput out) throws IOException {
|
|
}
|
|
|
|
// The method is ignored during record serialization
|
|
@Override
|
|
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
|
|
}
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p><small>New in 2020.3</small></p>
|
|
</body>
|
|
</html> |