Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: pkg/analyzer/lib/src/summary/format.dart

Issue 1414903005: Begin generating code for summary serialization/deserialization. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix handling of List<int> Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/builder.dart ('k') | pkg/analyzer/tool/generate_files » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4 //
5 // This file has been automatically generated. Please do not edit it manually.
6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files".
7
8 library analyzer.src.summary.format;
9
10 import 'builder.dart' as builder;
11
12 enum PrelinkedReferenceKind {
13 classOrEnum,
14 typedef,
15 other,
16 unresolved,
17 }
18
19 enum UnlinkedExecutableKind {
20 functionOrMethod,
21 getter,
22 setter,
23 constructor,
24 }
25
26 enum UnlinkedParamKind {
27 required,
28 positional,
29 named,
30 }
31
32 class PrelinkedDependency {
33 String _uri;
34
35 PrelinkedDependency.fromJson(Map json)
36 : _uri = json["uri"];
37
38 String get uri => _uri ?? '';
39 }
40
41 class PrelinkedDependencyBuilder {
42 final Map _json = {};
43
44 PrelinkedDependencyBuilder(builder.BuilderContext context);
45
46 void set uri(String _value) {
47 assert(!_json.containsKey("uri"));
48 if (_value != null) {
49 _json["uri"] = _value;
50 }
51 }
52
53 Object finish() => _json;
54 }
55
56 Object encodePrelinkedDependency(builder.BuilderContext builderContext, {String uri}) {
57 PrelinkedDependencyBuilder builder = new PrelinkedDependencyBuilder(builderCon text);
58 builder.uri = uri;
59 return builder.finish();
60 }
61
62 class PrelinkedLibrary {
63 UnlinkedLibrary _unlinked;
64 List<PrelinkedDependency> _dependencies;
65 List<int> _importDependencies;
66 List<PrelinkedReference> _references;
67
68 PrelinkedLibrary.fromJson(Map json)
69 : _unlinked = json["unlinked"] == null ? null : new UnlinkedLibrary.fromJson (json["unlinked"]),
70 _dependencies = json["dependencies"]?.map((x) => new PrelinkedDependency.f romJson(x))?.toList(),
71 _importDependencies = json["importDependencies"],
72 _references = json["references"]?.map((x) => new PrelinkedReference.fromJs on(x))?.toList();
73
74 UnlinkedLibrary get unlinked => _unlinked;
75 List<PrelinkedDependency> get dependencies => _dependencies ?? const <Prelinke dDependency>[];
76 List<int> get importDependencies => _importDependencies ?? const <int>[];
77 List<PrelinkedReference> get references => _references ?? const <PrelinkedRefe rence>[];
78 }
79
80 class PrelinkedLibraryBuilder {
81 final Map _json = {};
82
83 PrelinkedLibraryBuilder(builder.BuilderContext context);
84
85 void set unlinked(Object _value) {
86 assert(!_json.containsKey("unlinked"));
87 if (_value != null) {
88 _json["unlinked"] = _value;
89 }
90 }
91
92 void set dependencies(List<Object> _value) {
93 assert(!_json.containsKey("dependencies"));
94 if (_value != null || _value.isEmpty) {
95 _json["dependencies"] = _value.toList();
96 }
97 }
98
99 void set importDependencies(List<int> _value) {
100 assert(!_json.containsKey("importDependencies"));
101 if (_value != null || _value.isEmpty) {
102 _json["importDependencies"] = _value.toList();
103 }
104 }
105
106 void set references(List<Object> _value) {
107 assert(!_json.containsKey("references"));
108 if (_value != null || _value.isEmpty) {
109 _json["references"] = _value.toList();
110 }
111 }
112
113 Object finish() => _json;
114 }
115
116 Object encodePrelinkedLibrary(builder.BuilderContext builderContext, {Object unl inked, List<Object> dependencies, List<int> importDependencies, List<Object> ref erences}) {
117 PrelinkedLibraryBuilder builder = new PrelinkedLibraryBuilder(builderContext);
118 builder.unlinked = unlinked;
119 builder.dependencies = dependencies;
120 builder.importDependencies = importDependencies;
121 builder.references = references;
122 return builder.finish();
123 }
124
125 class PrelinkedReference {
126 int _dependency;
127 PrelinkedReferenceKind _kind;
128
129 PrelinkedReference.fromJson(Map json)
130 : _dependency = json["dependency"],
131 _kind = json["kind"] == null ? null : PrelinkedReferenceKind.values[json[" kind"]];
132
133 int get dependency => _dependency ?? 0;
134 PrelinkedReferenceKind get kind => _kind ?? PrelinkedReferenceKind.classOrEnum ;
135 }
136
137 class PrelinkedReferenceBuilder {
138 final Map _json = {};
139
140 PrelinkedReferenceBuilder(builder.BuilderContext context);
141
142 void set dependency(int _value) {
143 assert(!_json.containsKey("dependency"));
144 if (_value != null) {
145 _json["dependency"] = _value;
146 }
147 }
148
149 void set kind(PrelinkedReferenceKind _value) {
150 assert(!_json.containsKey("kind"));
151 if (_value != null || _value == PrelinkedReferenceKind.classOrEnum) {
152 _json["kind"] = _value.index;
153 }
154 }
155
156 Object finish() => _json;
157 }
158
159 Object encodePrelinkedReference(builder.BuilderContext builderContext, {int depe ndency, PrelinkedReferenceKind kind}) {
160 PrelinkedReferenceBuilder builder = new PrelinkedReferenceBuilder(builderConte xt);
161 builder.dependency = dependency;
162 builder.kind = kind;
163 return builder.finish();
164 }
165
166 class UnlinkedClass {
167 String _name;
168 int _unit;
169 List<UnlinkedTypeParam> _typeParameters;
170 UnlinkedTypeRef _supertype;
171 List<UnlinkedTypeRef> _mixins;
172 List<UnlinkedTypeRef> _interfaces;
173 List<UnlinkedVariable> _fields;
174 List<UnlinkedExecutable> _executables;
175 bool _isAbstract;
176 bool _isMixinApplication;
177
178 UnlinkedClass.fromJson(Map json)
179 : _name = json["name"],
180 _unit = json["unit"],
181 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam .fromJson(x))?.toList(),
182 _supertype = json["supertype"] == null ? null : new UnlinkedTypeRef.fromJs on(json["supertype"]),
183 _mixins = json["mixins"]?.map((x) => new UnlinkedTypeRef.fromJson(x))?.toL ist(),
184 _interfaces = json["interfaces"]?.map((x) => new UnlinkedTypeRef.fromJson( x))?.toList(),
185 _fields = json["fields"]?.map((x) => new UnlinkedVariable.fromJson(x))?.to List(),
186 _executables = json["executables"]?.map((x) => new UnlinkedExecutable.from Json(x))?.toList(),
187 _isAbstract = json["isAbstract"],
188 _isMixinApplication = json["isMixinApplication"];
189
190 String get name => _name ?? '';
191 int get unit => _unit ?? 0;
192 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink edTypeParam>[];
193 UnlinkedTypeRef get supertype => _supertype;
194 List<UnlinkedTypeRef> get mixins => _mixins ?? const <UnlinkedTypeRef>[];
195 List<UnlinkedTypeRef> get interfaces => _interfaces ?? const <UnlinkedTypeRef> [];
196 List<UnlinkedVariable> get fields => _fields ?? const <UnlinkedVariable>[];
197 List<UnlinkedExecutable> get executables => _executables ?? const <UnlinkedExe cutable>[];
198 bool get isAbstract => _isAbstract ?? false;
199 bool get isMixinApplication => _isMixinApplication ?? false;
200 }
201
202 class UnlinkedClassBuilder {
203 final Map _json = {};
204
205 UnlinkedClassBuilder(builder.BuilderContext context);
206
207 void set name(String _value) {
208 assert(!_json.containsKey("name"));
209 if (_value != null) {
210 _json["name"] = _value;
211 }
212 }
213
214 void set unit(int _value) {
215 assert(!_json.containsKey("unit"));
216 if (_value != null) {
217 _json["unit"] = _value;
218 }
219 }
220
221 void set typeParameters(List<Object> _value) {
222 assert(!_json.containsKey("typeParameters"));
223 if (_value != null || _value.isEmpty) {
224 _json["typeParameters"] = _value.toList();
225 }
226 }
227
228 void set supertype(Object _value) {
229 assert(!_json.containsKey("supertype"));
230 if (_value != null) {
231 _json["supertype"] = _value;
232 }
233 }
234
235 void set mixins(List<Object> _value) {
236 assert(!_json.containsKey("mixins"));
237 if (_value != null || _value.isEmpty) {
238 _json["mixins"] = _value.toList();
239 }
240 }
241
242 void set interfaces(List<Object> _value) {
243 assert(!_json.containsKey("interfaces"));
244 if (_value != null || _value.isEmpty) {
245 _json["interfaces"] = _value.toList();
246 }
247 }
248
249 void set fields(List<Object> _value) {
250 assert(!_json.containsKey("fields"));
251 if (_value != null || _value.isEmpty) {
252 _json["fields"] = _value.toList();
253 }
254 }
255
256 void set executables(List<Object> _value) {
257 assert(!_json.containsKey("executables"));
258 if (_value != null || _value.isEmpty) {
259 _json["executables"] = _value.toList();
260 }
261 }
262
263 void set isAbstract(bool _value) {
264 assert(!_json.containsKey("isAbstract"));
265 if (_value != null) {
266 _json["isAbstract"] = _value;
267 }
268 }
269
270 void set isMixinApplication(bool _value) {
271 assert(!_json.containsKey("isMixinApplication"));
272 if (_value != null) {
273 _json["isMixinApplication"] = _value;
274 }
275 }
276
277 Object finish() => _json;
278 }
279
280 Object encodeUnlinkedClass(builder.BuilderContext builderContext, {String name, int unit, List<Object> typeParameters, Object supertype, List<Object> mixins, Li st<Object> interfaces, List<Object> fields, List<Object> executables, bool isAbs tract, bool isMixinApplication}) {
281 UnlinkedClassBuilder builder = new UnlinkedClassBuilder(builderContext);
282 builder.name = name;
283 builder.unit = unit;
284 builder.typeParameters = typeParameters;
285 builder.supertype = supertype;
286 builder.mixins = mixins;
287 builder.interfaces = interfaces;
288 builder.fields = fields;
289 builder.executables = executables;
290 builder.isAbstract = isAbstract;
291 builder.isMixinApplication = isMixinApplication;
292 return builder.finish();
293 }
294
295 class UnlinkedCombinator {
296 List<UnlinkedCombinatorName> _shows;
297 List<UnlinkedCombinatorName> _hides;
298
299 UnlinkedCombinator.fromJson(Map json)
300 : _shows = json["shows"]?.map((x) => new UnlinkedCombinatorName.fromJson(x)) ?.toList(),
301 _hides = json["hides"]?.map((x) => new UnlinkedCombinatorName.fromJson(x)) ?.toList();
302
303 List<UnlinkedCombinatorName> get shows => _shows ?? const <UnlinkedCombinatorN ame>[];
304 List<UnlinkedCombinatorName> get hides => _hides ?? const <UnlinkedCombinatorN ame>[];
305 }
306
307 class UnlinkedCombinatorBuilder {
308 final Map _json = {};
309
310 UnlinkedCombinatorBuilder(builder.BuilderContext context);
311
312 void set shows(List<Object> _value) {
313 assert(!_json.containsKey("shows"));
314 if (_value != null || _value.isEmpty) {
315 _json["shows"] = _value.toList();
316 }
317 }
318
319 void set hides(List<Object> _value) {
320 assert(!_json.containsKey("hides"));
321 if (_value != null || _value.isEmpty) {
322 _json["hides"] = _value.toList();
323 }
324 }
325
326 Object finish() => _json;
327 }
328
329 Object encodeUnlinkedCombinator(builder.BuilderContext builderContext, {List<Obj ect> shows, List<Object> hides}) {
330 UnlinkedCombinatorBuilder builder = new UnlinkedCombinatorBuilder(builderConte xt);
331 builder.shows = shows;
332 builder.hides = hides;
333 return builder.finish();
334 }
335
336 class UnlinkedCombinatorName {
337 String _name;
338
339 UnlinkedCombinatorName.fromJson(Map json)
340 : _name = json["name"];
341
342 String get name => _name ?? '';
343 }
344
345 class UnlinkedCombinatorNameBuilder {
346 final Map _json = {};
347
348 UnlinkedCombinatorNameBuilder(builder.BuilderContext context);
349
350 void set name(String _value) {
351 assert(!_json.containsKey("name"));
352 if (_value != null) {
353 _json["name"] = _value;
354 }
355 }
356
357 Object finish() => _json;
358 }
359
360 Object encodeUnlinkedCombinatorName(builder.BuilderContext builderContext, {Stri ng name}) {
361 UnlinkedCombinatorNameBuilder builder = new UnlinkedCombinatorNameBuilder(buil derContext);
362 builder.name = name;
363 return builder.finish();
364 }
365
366 class UnlinkedEnum {
367 String _name;
368 List<UnlinkedEnumValue> _values;
369 int _unit;
370
371 UnlinkedEnum.fromJson(Map json)
372 : _name = json["name"],
373 _values = json["values"]?.map((x) => new UnlinkedEnumValue.fromJson(x))?.t oList(),
374 _unit = json["unit"];
375
376 String get name => _name ?? '';
377 List<UnlinkedEnumValue> get values => _values ?? const <UnlinkedEnumValue>[];
378 int get unit => _unit ?? 0;
379 }
380
381 class UnlinkedEnumBuilder {
382 final Map _json = {};
383
384 UnlinkedEnumBuilder(builder.BuilderContext context);
385
386 void set name(String _value) {
387 assert(!_json.containsKey("name"));
388 if (_value != null) {
389 _json["name"] = _value;
390 }
391 }
392
393 void set values(List<Object> _value) {
394 assert(!_json.containsKey("values"));
395 if (_value != null || _value.isEmpty) {
396 _json["values"] = _value.toList();
397 }
398 }
399
400 void set unit(int _value) {
401 assert(!_json.containsKey("unit"));
402 if (_value != null) {
403 _json["unit"] = _value;
404 }
405 }
406
407 Object finish() => _json;
408 }
409
410 Object encodeUnlinkedEnum(builder.BuilderContext builderContext, {String name, L ist<Object> values, int unit}) {
411 UnlinkedEnumBuilder builder = new UnlinkedEnumBuilder(builderContext);
412 builder.name = name;
413 builder.values = values;
414 builder.unit = unit;
415 return builder.finish();
416 }
417
418 class UnlinkedEnumValue {
419 String _name;
420
421 UnlinkedEnumValue.fromJson(Map json)
422 : _name = json["name"];
423
424 String get name => _name ?? '';
425 }
426
427 class UnlinkedEnumValueBuilder {
428 final Map _json = {};
429
430 UnlinkedEnumValueBuilder(builder.BuilderContext context);
431
432 void set name(String _value) {
433 assert(!_json.containsKey("name"));
434 if (_value != null) {
435 _json["name"] = _value;
436 }
437 }
438
439 Object finish() => _json;
440 }
441
442 Object encodeUnlinkedEnumValue(builder.BuilderContext builderContext, {String na me}) {
443 UnlinkedEnumValueBuilder builder = new UnlinkedEnumValueBuilder(builderContext );
444 builder.name = name;
445 return builder.finish();
446 }
447
448 class UnlinkedExecutable {
449 String _name;
450 int _unit;
451 List<UnlinkedTypeParam> _typeParameters;
452 UnlinkedTypeRef _returnType;
453 List<UnlinkedParam> _parameters;
454 UnlinkedExecutableKind _kind;
455 bool _isAbstract;
456 bool _isStatic;
457 bool _isConst;
458 bool _isFactory;
459
460 UnlinkedExecutable.fromJson(Map json)
461 : _name = json["name"],
462 _unit = json["unit"],
463 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam .fromJson(x))?.toList(),
464 _returnType = json["returnType"] == null ? null : new UnlinkedTypeRef.from Json(json["returnType"]),
465 _parameters = json["parameters"]?.map((x) => new UnlinkedParam.fromJson(x) )?.toList(),
466 _kind = json["kind"] == null ? null : UnlinkedExecutableKind.values[json[" kind"]],
467 _isAbstract = json["isAbstract"],
468 _isStatic = json["isStatic"],
469 _isConst = json["isConst"],
470 _isFactory = json["isFactory"];
471
472 String get name => _name ?? '';
473 int get unit => _unit ?? 0;
474 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink edTypeParam>[];
475 UnlinkedTypeRef get returnType => _returnType;
476 List<UnlinkedParam> get parameters => _parameters ?? const <UnlinkedParam>[];
477 UnlinkedExecutableKind get kind => _kind ?? UnlinkedExecutableKind.functionOrM ethod;
478 bool get isAbstract => _isAbstract ?? false;
479 bool get isStatic => _isStatic ?? false;
480 bool get isConst => _isConst ?? false;
481 bool get isFactory => _isFactory ?? false;
482 }
483
484 class UnlinkedExecutableBuilder {
485 final Map _json = {};
486
487 UnlinkedExecutableBuilder(builder.BuilderContext context);
488
489 void set name(String _value) {
490 assert(!_json.containsKey("name"));
491 if (_value != null) {
492 _json["name"] = _value;
493 }
494 }
495
496 void set unit(int _value) {
497 assert(!_json.containsKey("unit"));
498 if (_value != null) {
499 _json["unit"] = _value;
500 }
501 }
502
503 void set typeParameters(List<Object> _value) {
504 assert(!_json.containsKey("typeParameters"));
505 if (_value != null || _value.isEmpty) {
506 _json["typeParameters"] = _value.toList();
507 }
508 }
509
510 void set returnType(Object _value) {
511 assert(!_json.containsKey("returnType"));
512 if (_value != null) {
513 _json["returnType"] = _value;
514 }
515 }
516
517 void set parameters(List<Object> _value) {
518 assert(!_json.containsKey("parameters"));
519 if (_value != null || _value.isEmpty) {
520 _json["parameters"] = _value.toList();
521 }
522 }
523
524 void set kind(UnlinkedExecutableKind _value) {
525 assert(!_json.containsKey("kind"));
526 if (_value != null || _value == UnlinkedExecutableKind.functionOrMethod) {
527 _json["kind"] = _value.index;
528 }
529 }
530
531 void set isAbstract(bool _value) {
532 assert(!_json.containsKey("isAbstract"));
533 if (_value != null) {
534 _json["isAbstract"] = _value;
535 }
536 }
537
538 void set isStatic(bool _value) {
539 assert(!_json.containsKey("isStatic"));
540 if (_value != null) {
541 _json["isStatic"] = _value;
542 }
543 }
544
545 void set isConst(bool _value) {
546 assert(!_json.containsKey("isConst"));
547 if (_value != null) {
548 _json["isConst"] = _value;
549 }
550 }
551
552 void set isFactory(bool _value) {
553 assert(!_json.containsKey("isFactory"));
554 if (_value != null) {
555 _json["isFactory"] = _value;
556 }
557 }
558
559 Object finish() => _json;
560 }
561
562 Object encodeUnlinkedExecutable(builder.BuilderContext builderContext, {String n ame, int unit, List<Object> typeParameters, Object returnType, List<Object> para meters, UnlinkedExecutableKind kind, bool isAbstract, bool isStatic, bool isCons t, bool isFactory}) {
563 UnlinkedExecutableBuilder builder = new UnlinkedExecutableBuilder(builderConte xt);
564 builder.name = name;
565 builder.unit = unit;
566 builder.typeParameters = typeParameters;
567 builder.returnType = returnType;
568 builder.parameters = parameters;
569 builder.kind = kind;
570 builder.isAbstract = isAbstract;
571 builder.isStatic = isStatic;
572 builder.isConst = isConst;
573 builder.isFactory = isFactory;
574 return builder.finish();
575 }
576
577 class UnlinkedExport {
578 String _uri;
579 List<UnlinkedCombinator> _combinators;
580
581 UnlinkedExport.fromJson(Map json)
582 : _uri = json["uri"],
583 _combinators = json["combinators"]?.map((x) => new UnlinkedCombinator.from Json(x))?.toList();
584
585 String get uri => _uri ?? '';
586 List<UnlinkedCombinator> get combinators => _combinators ?? const <UnlinkedCom binator>[];
587 }
588
589 class UnlinkedExportBuilder {
590 final Map _json = {};
591
592 UnlinkedExportBuilder(builder.BuilderContext context);
593
594 void set uri(String _value) {
595 assert(!_json.containsKey("uri"));
596 if (_value != null) {
597 _json["uri"] = _value;
598 }
599 }
600
601 void set combinators(List<Object> _value) {
602 assert(!_json.containsKey("combinators"));
603 if (_value != null || _value.isEmpty) {
604 _json["combinators"] = _value.toList();
605 }
606 }
607
608 Object finish() => _json;
609 }
610
611 Object encodeUnlinkedExport(builder.BuilderContext builderContext, {String uri, List<Object> combinators}) {
612 UnlinkedExportBuilder builder = new UnlinkedExportBuilder(builderContext);
613 builder.uri = uri;
614 builder.combinators = combinators;
615 return builder.finish();
616 }
617
618 class UnlinkedImport {
619 String _uri;
620 int _offset;
621 int _prefix;
622 List<UnlinkedCombinator> _combinators;
623 bool _isDeferred;
624 bool _isImplicit;
625
626 UnlinkedImport.fromJson(Map json)
627 : _uri = json["uri"],
628 _offset = json["offset"],
629 _prefix = json["prefix"],
630 _combinators = json["combinators"]?.map((x) => new UnlinkedCombinator.from Json(x))?.toList(),
631 _isDeferred = json["isDeferred"],
632 _isImplicit = json["isImplicit"];
633
634 String get uri => _uri ?? '';
635 int get offset => _offset ?? 0;
636 int get prefix => _prefix ?? 0;
637 List<UnlinkedCombinator> get combinators => _combinators ?? const <UnlinkedCom binator>[];
638 bool get isDeferred => _isDeferred ?? false;
639 bool get isImplicit => _isImplicit ?? false;
640 }
641
642 class UnlinkedImportBuilder {
643 final Map _json = {};
644
645 UnlinkedImportBuilder(builder.BuilderContext context);
646
647 void set uri(String _value) {
648 assert(!_json.containsKey("uri"));
649 if (_value != null) {
650 _json["uri"] = _value;
651 }
652 }
653
654 void set offset(int _value) {
655 assert(!_json.containsKey("offset"));
656 if (_value != null) {
657 _json["offset"] = _value;
658 }
659 }
660
661 void set prefix(int _value) {
662 assert(!_json.containsKey("prefix"));
663 if (_value != null) {
664 _json["prefix"] = _value;
665 }
666 }
667
668 void set combinators(List<Object> _value) {
669 assert(!_json.containsKey("combinators"));
670 if (_value != null || _value.isEmpty) {
671 _json["combinators"] = _value.toList();
672 }
673 }
674
675 void set isDeferred(bool _value) {
676 assert(!_json.containsKey("isDeferred"));
677 if (_value != null) {
678 _json["isDeferred"] = _value;
679 }
680 }
681
682 void set isImplicit(bool _value) {
683 assert(!_json.containsKey("isImplicit"));
684 if (_value != null) {
685 _json["isImplicit"] = _value;
686 }
687 }
688
689 Object finish() => _json;
690 }
691
692 Object encodeUnlinkedImport(builder.BuilderContext builderContext, {String uri, int offset, int prefix, List<Object> combinators, bool isDeferred, bool isImplic it}) {
693 UnlinkedImportBuilder builder = new UnlinkedImportBuilder(builderContext);
694 builder.uri = uri;
695 builder.offset = offset;
696 builder.prefix = prefix;
697 builder.combinators = combinators;
698 builder.isDeferred = isDeferred;
699 builder.isImplicit = isImplicit;
700 return builder.finish();
701 }
702
703 class UnlinkedLibrary {
704 List<UnlinkedReference> _references;
705 List<UnlinkedUnit> _units;
706 String _name;
707 List<UnlinkedClass> _classes;
708 List<UnlinkedEnum> _enums;
709 List<UnlinkedExecutable> _executables;
710 List<UnlinkedExport> _exports;
711 List<UnlinkedImport> _imports;
712 List<UnlinkedTypedef> _typedefs;
713 List<UnlinkedVariable> _variables;
714 List<UnlinkedPrefix> _prefixes;
715
716 UnlinkedLibrary.fromJson(Map json)
717 : _references = json["references"]?.map((x) => new UnlinkedReference.fromJso n(x))?.toList(),
718 _units = json["units"]?.map((x) => new UnlinkedUnit.fromJson(x))?.toList() ,
719 _name = json["name"],
720 _classes = json["classes"]?.map((x) => new UnlinkedClass.fromJson(x))?.toL ist(),
721 _enums = json["enums"]?.map((x) => new UnlinkedEnum.fromJson(x))?.toList() ,
722 _executables = json["executables"]?.map((x) => new UnlinkedExecutable.from Json(x))?.toList(),
723 _exports = json["exports"]?.map((x) => new UnlinkedExport.fromJson(x))?.to List(),
724 _imports = json["imports"]?.map((x) => new UnlinkedImport.fromJson(x))?.to List(),
725 _typedefs = json["typedefs"]?.map((x) => new UnlinkedTypedef.fromJson(x))? .toList(),
726 _variables = json["variables"]?.map((x) => new UnlinkedVariable.fromJson(x ))?.toList(),
727 _prefixes = json["prefixes"]?.map((x) => new UnlinkedPrefix.fromJson(x))?. toList();
728
729 List<UnlinkedReference> get references => _references ?? const <UnlinkedRefere nce>[];
730 List<UnlinkedUnit> get units => _units ?? const <UnlinkedUnit>[];
731 String get name => _name ?? '';
732 List<UnlinkedClass> get classes => _classes ?? const <UnlinkedClass>[];
733 List<UnlinkedEnum> get enums => _enums ?? const <UnlinkedEnum>[];
734 List<UnlinkedExecutable> get executables => _executables ?? const <UnlinkedExe cutable>[];
735 List<UnlinkedExport> get exports => _exports ?? const <UnlinkedExport>[];
736 List<UnlinkedImport> get imports => _imports ?? const <UnlinkedImport>[];
737 List<UnlinkedTypedef> get typedefs => _typedefs ?? const <UnlinkedTypedef>[];
738 List<UnlinkedVariable> get variables => _variables ?? const <UnlinkedVariable> [];
739 List<UnlinkedPrefix> get prefixes => _prefixes ?? const <UnlinkedPrefix>[];
740 }
741
742 class UnlinkedLibraryBuilder {
743 final Map _json = {};
744
745 UnlinkedLibraryBuilder(builder.BuilderContext context);
746
747 void set references(List<Object> _value) {
748 assert(!_json.containsKey("references"));
749 if (_value != null || _value.isEmpty) {
750 _json["references"] = _value.toList();
751 }
752 }
753
754 void set units(List<Object> _value) {
755 assert(!_json.containsKey("units"));
756 if (_value != null || _value.isEmpty) {
757 _json["units"] = _value.toList();
758 }
759 }
760
761 void set name(String _value) {
762 assert(!_json.containsKey("name"));
763 if (_value != null) {
764 _json["name"] = _value;
765 }
766 }
767
768 void set classes(List<Object> _value) {
769 assert(!_json.containsKey("classes"));
770 if (_value != null || _value.isEmpty) {
771 _json["classes"] = _value.toList();
772 }
773 }
774
775 void set enums(List<Object> _value) {
776 assert(!_json.containsKey("enums"));
777 if (_value != null || _value.isEmpty) {
778 _json["enums"] = _value.toList();
779 }
780 }
781
782 void set executables(List<Object> _value) {
783 assert(!_json.containsKey("executables"));
784 if (_value != null || _value.isEmpty) {
785 _json["executables"] = _value.toList();
786 }
787 }
788
789 void set exports(List<Object> _value) {
790 assert(!_json.containsKey("exports"));
791 if (_value != null || _value.isEmpty) {
792 _json["exports"] = _value.toList();
793 }
794 }
795
796 void set imports(List<Object> _value) {
797 assert(!_json.containsKey("imports"));
798 if (_value != null || _value.isEmpty) {
799 _json["imports"] = _value.toList();
800 }
801 }
802
803 void set typedefs(List<Object> _value) {
804 assert(!_json.containsKey("typedefs"));
805 if (_value != null || _value.isEmpty) {
806 _json["typedefs"] = _value.toList();
807 }
808 }
809
810 void set variables(List<Object> _value) {
811 assert(!_json.containsKey("variables"));
812 if (_value != null || _value.isEmpty) {
813 _json["variables"] = _value.toList();
814 }
815 }
816
817 void set prefixes(List<Object> _value) {
818 assert(!_json.containsKey("prefixes"));
819 if (_value != null || _value.isEmpty) {
820 _json["prefixes"] = _value.toList();
821 }
822 }
823
824 Object finish() => _json;
825 }
826
827 Object encodeUnlinkedLibrary(builder.BuilderContext builderContext, {List<Object > references, List<Object> units, String name, List<Object> classes, List<Object > enums, List<Object> executables, List<Object> exports, List<Object> imports, L ist<Object> typedefs, List<Object> variables, List<Object> prefixes}) {
828 UnlinkedLibraryBuilder builder = new UnlinkedLibraryBuilder(builderContext);
829 builder.references = references;
830 builder.units = units;
831 builder.name = name;
832 builder.classes = classes;
833 builder.enums = enums;
834 builder.executables = executables;
835 builder.exports = exports;
836 builder.imports = imports;
837 builder.typedefs = typedefs;
838 builder.variables = variables;
839 builder.prefixes = prefixes;
840 return builder.finish();
841 }
842
843 class UnlinkedParam {
844 String _name;
845 UnlinkedTypeRef _type;
846 List<UnlinkedParam> _parameters;
847 UnlinkedParamKind _kind;
848 bool _isFunctionTyped;
849 bool _isInitializingFormal;
850
851 UnlinkedParam.fromJson(Map json)
852 : _name = json["name"],
853 _type = json["type"] == null ? null : new UnlinkedTypeRef.fromJson(json["t ype"]),
854 _parameters = json["parameters"]?.map((x) => new UnlinkedParam.fromJson(x) )?.toList(),
855 _kind = json["kind"] == null ? null : UnlinkedParamKind.values[json["kind" ]],
856 _isFunctionTyped = json["isFunctionTyped"],
857 _isInitializingFormal = json["isInitializingFormal"];
858
859 String get name => _name ?? '';
860 UnlinkedTypeRef get type => _type;
861 List<UnlinkedParam> get parameters => _parameters ?? const <UnlinkedParam>[];
862 UnlinkedParamKind get kind => _kind ?? UnlinkedParamKind.required;
863 bool get isFunctionTyped => _isFunctionTyped ?? false;
864 bool get isInitializingFormal => _isInitializingFormal ?? false;
865 }
866
867 class UnlinkedParamBuilder {
868 final Map _json = {};
869
870 UnlinkedParamBuilder(builder.BuilderContext context);
871
872 void set name(String _value) {
873 assert(!_json.containsKey("name"));
874 if (_value != null) {
875 _json["name"] = _value;
876 }
877 }
878
879 void set type(Object _value) {
880 assert(!_json.containsKey("type"));
881 if (_value != null) {
882 _json["type"] = _value;
883 }
884 }
885
886 void set parameters(List<Object> _value) {
887 assert(!_json.containsKey("parameters"));
888 if (_value != null || _value.isEmpty) {
889 _json["parameters"] = _value.toList();
890 }
891 }
892
893 void set kind(UnlinkedParamKind _value) {
894 assert(!_json.containsKey("kind"));
895 if (_value != null || _value == UnlinkedParamKind.required) {
896 _json["kind"] = _value.index;
897 }
898 }
899
900 void set isFunctionTyped(bool _value) {
901 assert(!_json.containsKey("isFunctionTyped"));
902 if (_value != null) {
903 _json["isFunctionTyped"] = _value;
904 }
905 }
906
907 void set isInitializingFormal(bool _value) {
908 assert(!_json.containsKey("isInitializingFormal"));
909 if (_value != null) {
910 _json["isInitializingFormal"] = _value;
911 }
912 }
913
914 Object finish() => _json;
915 }
916
917 Object encodeUnlinkedParam(builder.BuilderContext builderContext, {String name, Object type, List<Object> parameters, UnlinkedParamKind kind, bool isFunctionTyp ed, bool isInitializingFormal}) {
918 UnlinkedParamBuilder builder = new UnlinkedParamBuilder(builderContext);
919 builder.name = name;
920 builder.type = type;
921 builder.parameters = parameters;
922 builder.kind = kind;
923 builder.isFunctionTyped = isFunctionTyped;
924 builder.isInitializingFormal = isInitializingFormal;
925 return builder.finish();
926 }
927
928 class UnlinkedPrefix {
929 String _name;
930
931 UnlinkedPrefix.fromJson(Map json)
932 : _name = json["name"];
933
934 String get name => _name ?? '';
935 }
936
937 class UnlinkedPrefixBuilder {
938 final Map _json = {};
939
940 UnlinkedPrefixBuilder(builder.BuilderContext context);
941
942 void set name(String _value) {
943 assert(!_json.containsKey("name"));
944 if (_value != null) {
945 _json["name"] = _value;
946 }
947 }
948
949 Object finish() => _json;
950 }
951
952 Object encodeUnlinkedPrefix(builder.BuilderContext builderContext, {String name} ) {
953 UnlinkedPrefixBuilder builder = new UnlinkedPrefixBuilder(builderContext);
954 builder.name = name;
955 return builder.finish();
956 }
957
958 class UnlinkedReference {
959 String _name;
960 int _prefix;
961
962 UnlinkedReference.fromJson(Map json)
963 : _name = json["name"],
964 _prefix = json["prefix"];
965
966 String get name => _name ?? '';
967 int get prefix => _prefix ?? 0;
968 }
969
970 class UnlinkedReferenceBuilder {
971 final Map _json = {};
972
973 UnlinkedReferenceBuilder(builder.BuilderContext context);
974
975 void set name(String _value) {
976 assert(!_json.containsKey("name"));
977 if (_value != null) {
978 _json["name"] = _value;
979 }
980 }
981
982 void set prefix(int _value) {
983 assert(!_json.containsKey("prefix"));
984 if (_value != null) {
985 _json["prefix"] = _value;
986 }
987 }
988
989 Object finish() => _json;
990 }
991
992 Object encodeUnlinkedReference(builder.BuilderContext builderContext, {String na me, int prefix}) {
993 UnlinkedReferenceBuilder builder = new UnlinkedReferenceBuilder(builderContext );
994 builder.name = name;
995 builder.prefix = prefix;
996 return builder.finish();
997 }
998
999 class UnlinkedTypedef {
1000 String _name;
1001 int _unit;
1002 List<UnlinkedTypeParam> _typeParameters;
1003 UnlinkedTypeRef _returnType;
1004 List<UnlinkedParam> _parameters;
1005
1006 UnlinkedTypedef.fromJson(Map json)
1007 : _name = json["name"],
1008 _unit = json["unit"],
1009 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam .fromJson(x))?.toList(),
1010 _returnType = json["returnType"] == null ? null : new UnlinkedTypeRef.from Json(json["returnType"]),
1011 _parameters = json["parameters"]?.map((x) => new UnlinkedParam.fromJson(x) )?.toList();
1012
1013 String get name => _name ?? '';
1014 int get unit => _unit ?? 0;
1015 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink edTypeParam>[];
1016 UnlinkedTypeRef get returnType => _returnType;
1017 List<UnlinkedParam> get parameters => _parameters ?? const <UnlinkedParam>[];
1018 }
1019
1020 class UnlinkedTypedefBuilder {
1021 final Map _json = {};
1022
1023 UnlinkedTypedefBuilder(builder.BuilderContext context);
1024
1025 void set name(String _value) {
1026 assert(!_json.containsKey("name"));
1027 if (_value != null) {
1028 _json["name"] = _value;
1029 }
1030 }
1031
1032 void set unit(int _value) {
1033 assert(!_json.containsKey("unit"));
1034 if (_value != null) {
1035 _json["unit"] = _value;
1036 }
1037 }
1038
1039 void set typeParameters(List<Object> _value) {
1040 assert(!_json.containsKey("typeParameters"));
1041 if (_value != null || _value.isEmpty) {
1042 _json["typeParameters"] = _value.toList();
1043 }
1044 }
1045
1046 void set returnType(Object _value) {
1047 assert(!_json.containsKey("returnType"));
1048 if (_value != null) {
1049 _json["returnType"] = _value;
1050 }
1051 }
1052
1053 void set parameters(List<Object> _value) {
1054 assert(!_json.containsKey("parameters"));
1055 if (_value != null || _value.isEmpty) {
1056 _json["parameters"] = _value.toList();
1057 }
1058 }
1059
1060 Object finish() => _json;
1061 }
1062
1063 Object encodeUnlinkedTypedef(builder.BuilderContext builderContext, {String name , int unit, List<Object> typeParameters, Object returnType, List<Object> paramet ers}) {
1064 UnlinkedTypedefBuilder builder = new UnlinkedTypedefBuilder(builderContext);
1065 builder.name = name;
1066 builder.unit = unit;
1067 builder.typeParameters = typeParameters;
1068 builder.returnType = returnType;
1069 builder.parameters = parameters;
1070 return builder.finish();
1071 }
1072
1073 class UnlinkedTypeParam {
1074 String _name;
1075 UnlinkedTypeRef _bound;
1076
1077 UnlinkedTypeParam.fromJson(Map json)
1078 : _name = json["name"],
1079 _bound = json["bound"] == null ? null : new UnlinkedTypeRef.fromJson(json[ "bound"]);
1080
1081 String get name => _name ?? '';
1082 UnlinkedTypeRef get bound => _bound;
1083 }
1084
1085 class UnlinkedTypeParamBuilder {
1086 final Map _json = {};
1087
1088 UnlinkedTypeParamBuilder(builder.BuilderContext context);
1089
1090 void set name(String _value) {
1091 assert(!_json.containsKey("name"));
1092 if (_value != null) {
1093 _json["name"] = _value;
1094 }
1095 }
1096
1097 void set bound(Object _value) {
1098 assert(!_json.containsKey("bound"));
1099 if (_value != null) {
1100 _json["bound"] = _value;
1101 }
1102 }
1103
1104 Object finish() => _json;
1105 }
1106
1107 Object encodeUnlinkedTypeParam(builder.BuilderContext builderContext, {String na me, Object bound}) {
1108 UnlinkedTypeParamBuilder builder = new UnlinkedTypeParamBuilder(builderContext );
1109 builder.name = name;
1110 builder.bound = bound;
1111 return builder.finish();
1112 }
1113
1114 class UnlinkedTypeRef {
1115 int _reference;
1116 int _paramReference;
1117 List<UnlinkedTypeRef> _typeArguments;
1118
1119 UnlinkedTypeRef.fromJson(Map json)
1120 : _reference = json["reference"],
1121 _paramReference = json["paramReference"],
1122 _typeArguments = json["typeArguments"]?.map((x) => new UnlinkedTypeRef.fro mJson(x))?.toList();
1123
1124 int get reference => _reference ?? 0;
1125 int get paramReference => _paramReference ?? 0;
1126 List<UnlinkedTypeRef> get typeArguments => _typeArguments ?? const <UnlinkedTy peRef>[];
1127 }
1128
1129 class UnlinkedTypeRefBuilder {
1130 final Map _json = {};
1131
1132 UnlinkedTypeRefBuilder(builder.BuilderContext context);
1133
1134 void set reference(int _value) {
1135 assert(!_json.containsKey("reference"));
1136 if (_value != null) {
1137 _json["reference"] = _value;
1138 }
1139 }
1140
1141 void set paramReference(int _value) {
1142 assert(!_json.containsKey("paramReference"));
1143 if (_value != null) {
1144 _json["paramReference"] = _value;
1145 }
1146 }
1147
1148 void set typeArguments(List<Object> _value) {
1149 assert(!_json.containsKey("typeArguments"));
1150 if (_value != null || _value.isEmpty) {
1151 _json["typeArguments"] = _value.toList();
1152 }
1153 }
1154
1155 Object finish() => _json;
1156 }
1157
1158 Object encodeUnlinkedTypeRef(builder.BuilderContext builderContext, {int referen ce, int paramReference, List<Object> typeArguments}) {
1159 UnlinkedTypeRefBuilder builder = new UnlinkedTypeRefBuilder(builderContext);
1160 builder.reference = reference;
1161 builder.paramReference = paramReference;
1162 builder.typeArguments = typeArguments;
1163 return builder.finish();
1164 }
1165
1166 class UnlinkedUnit {
1167 String _uri;
1168
1169 UnlinkedUnit.fromJson(Map json)
1170 : _uri = json["uri"];
1171
1172 String get uri => _uri ?? '';
1173 }
1174
1175 class UnlinkedUnitBuilder {
1176 final Map _json = {};
1177
1178 UnlinkedUnitBuilder(builder.BuilderContext context);
1179
1180 void set uri(String _value) {
1181 assert(!_json.containsKey("uri"));
1182 if (_value != null) {
1183 _json["uri"] = _value;
1184 }
1185 }
1186
1187 Object finish() => _json;
1188 }
1189
1190 Object encodeUnlinkedUnit(builder.BuilderContext builderContext, {String uri}) {
1191 UnlinkedUnitBuilder builder = new UnlinkedUnitBuilder(builderContext);
1192 builder.uri = uri;
1193 return builder.finish();
1194 }
1195
1196 class UnlinkedVariable {
1197 String _name;
1198 int _unit;
1199 UnlinkedTypeRef _type;
1200 bool _isStatic;
1201 bool _isFinal;
1202 bool _isConst;
1203
1204 UnlinkedVariable.fromJson(Map json)
1205 : _name = json["name"],
1206 _unit = json["unit"],
1207 _type = json["type"] == null ? null : new UnlinkedTypeRef.fromJson(json["t ype"]),
1208 _isStatic = json["isStatic"],
1209 _isFinal = json["isFinal"],
1210 _isConst = json["isConst"];
1211
1212 String get name => _name ?? '';
1213 int get unit => _unit ?? 0;
1214 UnlinkedTypeRef get type => _type;
1215 bool get isStatic => _isStatic ?? false;
1216 bool get isFinal => _isFinal ?? false;
1217 bool get isConst => _isConst ?? false;
1218 }
1219
1220 class UnlinkedVariableBuilder {
1221 final Map _json = {};
1222
1223 UnlinkedVariableBuilder(builder.BuilderContext context);
1224
1225 void set name(String _value) {
1226 assert(!_json.containsKey("name"));
1227 if (_value != null) {
1228 _json["name"] = _value;
1229 }
1230 }
1231
1232 void set unit(int _value) {
1233 assert(!_json.containsKey("unit"));
1234 if (_value != null) {
1235 _json["unit"] = _value;
1236 }
1237 }
1238
1239 void set type(Object _value) {
1240 assert(!_json.containsKey("type"));
1241 if (_value != null) {
1242 _json["type"] = _value;
1243 }
1244 }
1245
1246 void set isStatic(bool _value) {
1247 assert(!_json.containsKey("isStatic"));
1248 if (_value != null) {
1249 _json["isStatic"] = _value;
1250 }
1251 }
1252
1253 void set isFinal(bool _value) {
1254 assert(!_json.containsKey("isFinal"));
1255 if (_value != null) {
1256 _json["isFinal"] = _value;
1257 }
1258 }
1259
1260 void set isConst(bool _value) {
1261 assert(!_json.containsKey("isConst"));
1262 if (_value != null) {
1263 _json["isConst"] = _value;
1264 }
1265 }
1266
1267 Object finish() => _json;
1268 }
1269
1270 Object encodeUnlinkedVariable(builder.BuilderContext builderContext, {String nam e, int unit, Object type, bool isStatic, bool isFinal, bool isConst}) {
1271 UnlinkedVariableBuilder builder = new UnlinkedVariableBuilder(builderContext);
1272 builder.name = name;
1273 builder.unit = unit;
1274 builder.type = type;
1275 builder.isStatic = isStatic;
1276 builder.isFinal = isFinal;
1277 builder.isConst = isConst;
1278 return builder.finish();
1279 }
1280
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/builder.dart ('k') | pkg/analyzer/tool/generate_files » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698