2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
- /**
6
- * This file contains a set of concrete classes representing an in-memory
7
- * semantic model of the IDL used to code generate summary serialization and
8
- * deserialization code.
9
- */
5
+ /// This file contains a set of concrete classes representing an in-memory
6
+ /// semantic model of the IDL used to code generate summary serialization and
7
+ /// deserialization code.
10
8
import 'package:meta/meta.dart' ;
11
9
12
- /**
13
- * Information about a single class defined in the IDL.
14
- */
10
+ /// Information about a single class defined in the IDL.
15
11
class ClassDeclaration extends Declaration {
16
- /**
17
- * All fields defined in the class, including deprecated ones.
18
- */
12
+ /// All fields defined in the class, including deprecated ones.
19
13
final List <FieldDeclaration > allFields = < FieldDeclaration > [];
20
14
21
- /**
22
- * Indicates whether the class has the `topLevel` annotation.
23
- */
15
+ /// Indicates whether the class has the `topLevel` annotation.
24
16
final bool isTopLevel;
25
17
26
- /**
27
- * If [isTopLevel] is `true` and a file identifier was specified for this
28
- * class, the file identifier string. Otherwise `null` .
29
- */
18
+ /// If [isTopLevel] is `true` and a file identifier was specified for this
19
+ /// class, the file identifier string. Otherwise `null` .
30
20
final String fileIdentifier;
31
21
32
- /**
33
- * Indicates whether the class has the `deprecated` annotation.
34
- */
22
+ /// Indicates whether the class has the `deprecated` annotation.
35
23
final bool isDeprecated;
36
24
37
25
final String variantField;
@@ -45,78 +33,52 @@ class ClassDeclaration extends Declaration {
45
33
@required this .variantField,
46
34
}) : super (documentation, name);
47
35
48
- /**
49
- * Get the non-deprecated fields defined in the class.
50
- */
36
+ /// Get the non-deprecated fields defined in the class.
51
37
Iterable <FieldDeclaration > get fields =>
52
38
allFields.where ((FieldDeclaration field) => ! field.isDeprecated);
53
39
}
54
40
55
- /**
56
- * Information about a declaration in the IDL.
57
- */
41
+ /// Information about a declaration in the IDL.
58
42
class Declaration {
59
- /**
60
- * The optional documentation, may be `null` .
61
- */
43
+ /// The optional documentation, may be `null` .
62
44
final String documentation;
63
45
64
- /**
65
- * The name of the declaration.
66
- */
46
+ /// The name of the declaration.
67
47
final String name;
68
48
69
49
Declaration (this .documentation, this .name);
70
50
}
71
51
72
- /**
73
- * Information about a single enum defined in the IDL.
74
- */
52
+ /// Information about a single enum defined in the IDL.
75
53
class EnumDeclaration extends Declaration {
76
- /**
77
- * List of enumerated values.
78
- */
54
+ /// List of enumerated values.
79
55
final List <EnumValueDeclaration > values = < EnumValueDeclaration > [];
80
56
81
57
EnumDeclaration (String documentation, String name)
82
58
: super (documentation, name);
83
59
}
84
60
85
- /**
86
- * Information about a single enum value defined in the IDL.
87
- */
61
+ /// Information about a single enum value defined in the IDL.
88
62
class EnumValueDeclaration extends Declaration {
89
63
EnumValueDeclaration (String documentation, String name)
90
64
: super (documentation, name);
91
65
}
92
66
93
- /**
94
- * Information about a single class field defined in the IDL.
95
- */
67
+ /// Information about a single class field defined in the IDL.
96
68
class FieldDeclaration extends Declaration {
97
- /**
98
- * The file of the field.
99
- */
69
+ /// The file of the field.
100
70
final FieldType type;
101
71
102
- /**
103
- * The id of the field.
104
- */
72
+ /// The id of the field.
105
73
final int id;
106
74
107
- /**
108
- * Indicates whether the field is deprecated.
109
- */
75
+ /// Indicates whether the field is deprecated.
110
76
final bool isDeprecated;
111
77
112
- /**
113
- * Indicates whether the field is informative.
114
- */
78
+ /// Indicates whether the field is informative.
115
79
final bool isInformative;
116
80
117
- /**
118
- * Maps logical property names to logical property.
119
- */
81
+ /// Maps logical property names to logical property.
120
82
final Map <String , LogicalProperty > logicalProperties;
121
83
122
84
FieldDeclaration ({
@@ -130,19 +92,13 @@ class FieldDeclaration extends Declaration {
130
92
}) : super (documentation, name);
131
93
}
132
94
133
- /**
134
- * Information about the type of a class field defined in the IDL.
135
- */
95
+ /// Information about the type of a class field defined in the IDL.
136
96
class FieldType {
137
- /**
138
- * Type of the field (e.g. 'int').
139
- */
97
+ /// Type of the field (e.g. 'int').
140
98
final String typeName;
141
99
142
- /**
143
- * Indicates whether this field contains a list of the type specified in
144
- * [typeName] .
145
- */
100
+ /// Indicates whether this field contains a list of the type specified in
101
+ /// [typeName] .
146
102
final bool isList;
147
103
148
104
FieldType (this .typeName, this .isList);
@@ -166,38 +122,24 @@ class FieldType {
166
122
String toString () => isList ? 'List<$typeName >' : typeName;
167
123
}
168
124
169
- /**
170
- * Top level representation of the summary IDL.
171
- */
125
+ /// Top level representation of the summary IDL.
172
126
class Idl {
173
- /**
174
- * Classes defined in the IDL.
175
- */
127
+ /// Classes defined in the IDL.
176
128
final Map <String , ClassDeclaration > classes = < String , ClassDeclaration > {};
177
129
178
- /**
179
- * Enums defined in the IDL.
180
- */
130
+ /// Enums defined in the IDL.
181
131
final Map <String , EnumDeclaration > enums = < String , EnumDeclaration > {};
182
132
}
183
133
184
- /**
185
- * Information about a logical property mapped to a single data fields.
186
- */
134
+ /// Information about a logical property mapped to a single data fields.
187
135
class LogicalProperty {
188
- /**
189
- * Indicates whether the property is deprecated.
190
- */
136
+ /// Indicates whether the property is deprecated.
191
137
final bool isDeprecated;
192
138
193
- /**
194
- * Indicates whether the property is informative.
195
- */
139
+ /// Indicates whether the property is informative.
196
140
final bool isInformative;
197
141
198
- /**
199
- * Names of variants in which this property is available.
200
- */
142
+ /// Names of variants in which this property is available.
201
143
final List <String > variants;
202
144
203
145
LogicalProperty ({
0 commit comments