22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
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.
108import 'package:meta/meta.dart' ;
119
12- /**
13- * Information about a single class defined in the IDL.
14- */
10+ /// Information about a single class defined in the IDL.
1511class 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.
1913 final List <FieldDeclaration > allFields = < FieldDeclaration > [];
2014
21- /**
22- * Indicates whether the class has the `topLevel` annotation.
23- */
15+ /// Indicates whether the class has the `topLevel` annotation.
2416 final bool isTopLevel;
2517
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` .
3020 final String fileIdentifier;
3121
32- /**
33- * Indicates whether the class has the `deprecated` annotation.
34- */
22+ /// Indicates whether the class has the `deprecated` annotation.
3523 final bool isDeprecated;
3624
3725 final String variantField;
@@ -45,78 +33,52 @@ class ClassDeclaration extends Declaration {
4533 @required this .variantField,
4634 }) : super (documentation, name);
4735
48- /**
49- * Get the non-deprecated fields defined in the class.
50- */
36+ /// Get the non-deprecated fields defined in the class.
5137 Iterable <FieldDeclaration > get fields =>
5238 allFields.where ((FieldDeclaration field) => ! field.isDeprecated);
5339}
5440
55- /**
56- * Information about a declaration in the IDL.
57- */
41+ /// Information about a declaration in the IDL.
5842class Declaration {
59- /**
60- * The optional documentation, may be `null` .
61- */
43+ /// The optional documentation, may be `null` .
6244 final String documentation;
6345
64- /**
65- * The name of the declaration.
66- */
46+ /// The name of the declaration.
6747 final String name;
6848
6949 Declaration (this .documentation, this .name);
7050}
7151
72- /**
73- * Information about a single enum defined in the IDL.
74- */
52+ /// Information about a single enum defined in the IDL.
7553class EnumDeclaration extends Declaration {
76- /**
77- * List of enumerated values.
78- */
54+ /// List of enumerated values.
7955 final List <EnumValueDeclaration > values = < EnumValueDeclaration > [];
8056
8157 EnumDeclaration (String documentation, String name)
8258 : super (documentation, name);
8359}
8460
85- /**
86- * Information about a single enum value defined in the IDL.
87- */
61+ /// Information about a single enum value defined in the IDL.
8862class EnumValueDeclaration extends Declaration {
8963 EnumValueDeclaration (String documentation, String name)
9064 : super (documentation, name);
9165}
9266
93- /**
94- * Information about a single class field defined in the IDL.
95- */
67+ /// Information about a single class field defined in the IDL.
9668class FieldDeclaration extends Declaration {
97- /**
98- * The file of the field.
99- */
69+ /// The file of the field.
10070 final FieldType type;
10171
102- /**
103- * The id of the field.
104- */
72+ /// The id of the field.
10573 final int id;
10674
107- /**
108- * Indicates whether the field is deprecated.
109- */
75+ /// Indicates whether the field is deprecated.
11076 final bool isDeprecated;
11177
112- /**
113- * Indicates whether the field is informative.
114- */
78+ /// Indicates whether the field is informative.
11579 final bool isInformative;
11680
117- /**
118- * Maps logical property names to logical property.
119- */
81+ /// Maps logical property names to logical property.
12082 final Map <String , LogicalProperty > logicalProperties;
12183
12284 FieldDeclaration ({
@@ -130,19 +92,13 @@ class FieldDeclaration extends Declaration {
13092 }) : super (documentation, name);
13193}
13294
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.
13696class FieldType {
137- /**
138- * Type of the field (e.g. 'int').
139- */
97+ /// Type of the field (e.g. 'int').
14098 final String typeName;
14199
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] .
146102 final bool isList;
147103
148104 FieldType (this .typeName, this .isList);
@@ -166,38 +122,24 @@ class FieldType {
166122 String toString () => isList ? 'List<$typeName >' : typeName;
167123}
168124
169- /**
170- * Top level representation of the summary IDL.
171- */
125+ /// Top level representation of the summary IDL.
172126class Idl {
173- /**
174- * Classes defined in the IDL.
175- */
127+ /// Classes defined in the IDL.
176128 final Map <String , ClassDeclaration > classes = < String , ClassDeclaration > {};
177129
178- /**
179- * Enums defined in the IDL.
180- */
130+ /// Enums defined in the IDL.
181131 final Map <String , EnumDeclaration > enums = < String , EnumDeclaration > {};
182132}
183133
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.
187135class LogicalProperty {
188- /**
189- * Indicates whether the property is deprecated.
190- */
136+ /// Indicates whether the property is deprecated.
191137 final bool isDeprecated;
192138
193- /**
194- * Indicates whether the property is informative.
195- */
139+ /// Indicates whether the property is informative.
196140 final bool isInformative;
197141
198- /**
199- * Names of variants in which this property is available.
200- */
142+ /// Names of variants in which this property is available.
201143 final List <String > variants;
202144
203145 LogicalProperty ({
0 commit comments