/
ISerial.xml
95 lines (87 loc) · 6.07 KB
/
ISerial.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<Type Name="ISerial" FullName="Java.IO.ISerial">
<TypeSignature Language="C#" Value="public interface ISerial : IDisposable, Java.Interop.IJavaPeerable, Java.Lang.Annotation.IAnnotation" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract beforefieldinit ISerial implements class Android.Runtime.IJavaObject, class Java.Interop.IJavaPeerable, class Java.Lang.Annotation.IAnnotation, class System.IDisposable" />
<TypeSignature Language="DocId" Value="T:Java.IO.ISerial" />
<TypeSignature Language="F#" Value="type ISerial = interface
 interface IAnnotation
 interface IJavaObject
 interface IDisposable
 interface IJavaPeerable" />
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Interfaces>
<Interface>
<InterfaceName>Android.Runtime.IJavaObject</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.Interop.IJavaPeerable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.Lang.Annotation.IAnnotation</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("java/io/Serial", "", "Java.IO.ISerialInvoker", ApiSince=34)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("java/io/Serial", "", "Java.IO.ISerialInvoker", ApiSince=34)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Indicates that an annotated field or method is part of the Serializable serialization mechanism defined by the
<cite>Java Object Serialization Specification</cite>.</summary>
<remarks>
<para>Indicates that an annotated field or method is part of the Serializable serialization mechanism defined by the
<cite>Java Object Serialization Specification</cite>. This
annotation type is intended to allow compile-time checking of
serialization-related declarations, analogous to the checking
enabled by the <c>java.lang.Override</c> annotation type to
validate method overriding. <c>Serializable</c> classes are encouraged to
use <c>@Serial</c> annotations to help a compiler catch
mis-declared serialization-related fields and methods,
mis-declarations that may otherwise be difficult to detect.</para>
<para>Specifically, annotations of this type should be
applied to serialization-related methods and fields in classes
declared to be <c>Serializable</c>. The five serialization-related
methods are:
<ul>
<li><c>private void writeObject(java.io.ObjectOutputStream stream) throws IOException</c><li><c>private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException</c><li><c>private void readObjectNoData() throws ObjectStreamException</c><li><i>ANY-ACCESS-MODIFIER</i><c>Object writeReplace() throws ObjectStreamException</c><li><i>ANY-ACCESS-MODIFIER</i><c>Object readResolve() throws ObjectStreamException</c></ul>
The two serialization-related fields are:
<ul>
<li><c>private static final ObjectStreamField[] serialPersistentFields</c><li><c>private static final long serialVersionUID</c></ul>
Compilers are encouraged to validate that a method or field marked with a
<c>@Serial</c> annotation is one of the defined serialization-related
methods or fields declared in a meaningful context and issue a warning
if that is not the case.</para>
<para>It is a semantic error to apply this annotation to other fields or methods, including:
<ul>
<li>fields or methods in a class that is not <c>Serializable</c><li>fields or methods of the proper structural declaration, but in
a type where they are ineffectual. For example, <c>enum</c> types
are defined to have a <c>serialVersionUID</c> of <c>0L</c> so a
<c>serialVersionUID</c> field declared in an <c>enum</c> type is
ignored. The five serialization-related methods identified above
are likewise ignored for an <c>enum</c> type.
<li>in a class that is <c>Externalizable</c>:
<ul>
<li> method declarations of <c>writeObject</c>, <c>readObject</c>, and <c>readObjectNoData</c><li>a field declaration for <c>serialPersistentFields</c></ul>
While the <c>Externalizable</c> interface extends <c>Serializable</c>, the three methods and one field above are
<em>not</em> used for externalizable classes.
</ul>
Note that serialization mechanism accesses its designated fields
and methods reflectively and those fields and methods may appear
otherwise unused in a <c>Serializable</c> class.</para>
<para>Added in 14.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/io/Serial" title="Reference documentation">Java documentation for <code>java.io.Serial</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
<Members />
</Type>