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

Unified Diff: pkg/analyzer/lib/src/summary/format.dart

Issue 1581993002: Make summary builder classes implement summary interfaces. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/name_filter_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/format.dart
diff --git a/pkg/analyzer/lib/src/summary/format.dart b/pkg/analyzer/lib/src/summary/format.dart
index 97f9db68732068bcab3dbd9070e7f9bd4cd2736d..d079941eea12192f5f2ea1dad48d9a4070db6fe3 100644
--- a/pkg/analyzer/lib/src/summary/format.dart
+++ b/pkg/analyzer/lib/src/summary/format.dart
@@ -41,7 +41,7 @@ enum UnlinkedParamKind {
named,
}
-class PrelinkedDependencyBuilder {
+class PrelinkedDependencyBuilder extends Object with _PrelinkedDependencyMixin implements PrelinkedDependency {
bool _finished = false;
String _uri;
@@ -49,6 +49,9 @@ class PrelinkedDependencyBuilder {
PrelinkedDependencyBuilder();
+ @override
+ String get uri => _uri ?? '';
+
/**
* The relative URI of the dependent library. This URI is relative to the
* importing library, even if there are intervening `export` declarations.
@@ -61,6 +64,9 @@ class PrelinkedDependencyBuilder {
_uri = _value;
}
+ @override
+ List<String> get parts => _parts ?? const <String>[];
+
/**
* URI for the compilation units listed in the library's `part` declarations.
* These URIs are relative to the importing library.
@@ -128,7 +134,7 @@ class _PrelinkedDependencyReader extends fb.TableReader<_PrelinkedDependencyImpl
_PrelinkedDependencyImpl createObject(fb.BufferPointer bp) => new _PrelinkedDependencyImpl(bp);
}
-class _PrelinkedDependencyImpl implements PrelinkedDependency {
+class _PrelinkedDependencyImpl extends Object with _PrelinkedDependencyMixin implements PrelinkedDependency {
final fb.BufferPointer _bp;
_PrelinkedDependencyImpl(this._bp);
@@ -137,12 +143,6 @@ class _PrelinkedDependencyImpl implements PrelinkedDependency {
List<String> _parts;
@override
- Map<String, Object> toMap() => {
- "uri": uri,
- "parts": parts,
- };
-
- @override
String get uri {
_uri ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _uri;
@@ -155,7 +155,15 @@ class _PrelinkedDependencyImpl implements PrelinkedDependency {
}
}
-class PrelinkedLibraryBuilder {
+abstract class _PrelinkedDependencyMixin implements PrelinkedDependency {
+ @override
+ Map<String, Object> toMap() => {
+ "uri": uri,
+ "parts": parts,
+ };
+}
+
+class PrelinkedLibraryBuilder extends Object with _PrelinkedLibraryMixin implements PrelinkedLibrary {
bool _finished = false;
List<PrelinkedUnitBuilder> _units;
@@ -164,6 +172,9 @@ class PrelinkedLibraryBuilder {
PrelinkedLibraryBuilder();
+ @override
+ List<PrelinkedUnit> get units => _units ?? const <PrelinkedUnit>[];
+
/**
* The pre-linked summary of all the compilation units constituting the
* library. The summary of the defining compilation unit is listed first,
@@ -175,6 +186,9 @@ class PrelinkedLibraryBuilder {
_units = _value;
}
+ @override
+ List<PrelinkedDependency> get dependencies => _dependencies ?? const <PrelinkedDependency>[];
+
/**
* The libraries that this library depends on (either via an explicit import
* statement or via the implicit dependencies on `dart:core` and
@@ -189,6 +203,9 @@ class PrelinkedLibraryBuilder {
_dependencies = _value;
}
+ @override
+ List<int> get importDependencies => _importDependencies ?? const <int>[];
+
/**
* For each import in [UnlinkedUnit.imports], an index into [dependencies]
* of the library being imported.
@@ -288,7 +305,7 @@ class _PrelinkedLibraryReader extends fb.TableReader<_PrelinkedLibraryImpl> {
_PrelinkedLibraryImpl createObject(fb.BufferPointer bp) => new _PrelinkedLibraryImpl(bp);
}
-class _PrelinkedLibraryImpl implements PrelinkedLibrary {
+class _PrelinkedLibraryImpl extends Object with _PrelinkedLibraryMixin implements PrelinkedLibrary {
final fb.BufferPointer _bp;
_PrelinkedLibraryImpl(this._bp);
@@ -298,13 +315,6 @@ class _PrelinkedLibraryImpl implements PrelinkedLibrary {
List<int> _importDependencies;
@override
- Map<String, Object> toMap() => {
- "units": units,
- "dependencies": dependencies,
- "importDependencies": importDependencies,
- };
-
- @override
List<PrelinkedUnit> get units {
_units ??= const fb.ListReader<PrelinkedUnit>(const _PrelinkedUnitReader()).vTableGet(_bp, 0, const <PrelinkedUnit>[]);
return _units;
@@ -323,7 +333,16 @@ class _PrelinkedLibraryImpl implements PrelinkedLibrary {
}
}
-class PrelinkedReferenceBuilder {
+abstract class _PrelinkedLibraryMixin implements PrelinkedLibrary {
+ @override
+ Map<String, Object> toMap() => {
+ "units": units,
+ "dependencies": dependencies,
+ "importDependencies": importDependencies,
+ };
+}
+
+class PrelinkedReferenceBuilder extends Object with _PrelinkedReferenceMixin implements PrelinkedReference {
bool _finished = false;
int _dependency;
@@ -333,6 +352,9 @@ class PrelinkedReferenceBuilder {
PrelinkedReferenceBuilder();
+ @override
+ int get dependency => _dependency ?? 0;
+
/**
* Index into [PrelinkedLibrary.dependencies] indicating which imported library
* declares the entity being referred to.
@@ -342,6 +364,9 @@ class PrelinkedReferenceBuilder {
_dependency = _value;
}
+ @override
+ PrelinkedReferenceKind get kind => _kind ?? PrelinkedReferenceKind.classOrEnum;
+
/**
* The kind of the entity being referred to. For the pseudo-type `dynamic`,
* the kind is [PrelinkedReferenceKind.classOrEnum].
@@ -351,6 +376,9 @@ class PrelinkedReferenceBuilder {
_kind = _value;
}
+ @override
+ int get unit => _unit ?? 0;
+
/**
* Integer index indicating which unit in the imported library contains the
* definition of the entity. As with indices into [PrelinkedLibrary.units],
@@ -362,6 +390,9 @@ class PrelinkedReferenceBuilder {
_unit = _value;
}
+ @override
+ int get numTypeParameters => _numTypeParameters ?? 0;
+
/**
* If the entity being referred to is generic, the number of type parameters
* it accepts. Otherwise zero.
@@ -439,7 +470,7 @@ class _PrelinkedReferenceReader extends fb.TableReader<_PrelinkedReferenceImpl>
_PrelinkedReferenceImpl createObject(fb.BufferPointer bp) => new _PrelinkedReferenceImpl(bp);
}
-class _PrelinkedReferenceImpl implements PrelinkedReference {
+class _PrelinkedReferenceImpl extends Object with _PrelinkedReferenceMixin implements PrelinkedReference {
final fb.BufferPointer _bp;
_PrelinkedReferenceImpl(this._bp);
@@ -450,14 +481,6 @@ class _PrelinkedReferenceImpl implements PrelinkedReference {
int _numTypeParameters;
@override
- Map<String, Object> toMap() => {
- "dependency": dependency,
- "kind": kind,
- "unit": unit,
- "numTypeParameters": numTypeParameters,
- };
-
- @override
int get dependency {
_dependency ??= const fb.Int32Reader().vTableGet(_bp, 0, 0);
return _dependency;
@@ -482,13 +505,26 @@ class _PrelinkedReferenceImpl implements PrelinkedReference {
}
}
-class PrelinkedUnitBuilder {
+abstract class _PrelinkedReferenceMixin implements PrelinkedReference {
+ @override
+ Map<String, Object> toMap() => {
+ "dependency": dependency,
+ "kind": kind,
+ "unit": unit,
+ "numTypeParameters": numTypeParameters,
+ };
+}
+
+class PrelinkedUnitBuilder extends Object with _PrelinkedUnitMixin implements PrelinkedUnit {
bool _finished = false;
List<PrelinkedReferenceBuilder> _references;
PrelinkedUnitBuilder();
+ @override
+ List<PrelinkedReference> get references => _references ?? const <PrelinkedReference>[];
+
/**
* For each reference in [UnlinkedUnit.references], information about how
* that reference is resolved.
@@ -538,7 +574,7 @@ class _PrelinkedUnitReader extends fb.TableReader<_PrelinkedUnitImpl> {
_PrelinkedUnitImpl createObject(fb.BufferPointer bp) => new _PrelinkedUnitImpl(bp);
}
-class _PrelinkedUnitImpl implements PrelinkedUnit {
+class _PrelinkedUnitImpl extends Object with _PrelinkedUnitMixin implements PrelinkedUnit {
final fb.BufferPointer _bp;
_PrelinkedUnitImpl(this._bp);
@@ -546,18 +582,20 @@ class _PrelinkedUnitImpl implements PrelinkedUnit {
List<PrelinkedReference> _references;
@override
- Map<String, Object> toMap() => {
- "references": references,
- };
-
- @override
List<PrelinkedReference> get references {
_references ??= const fb.ListReader<PrelinkedReference>(const _PrelinkedReferenceReader()).vTableGet(_bp, 0, const <PrelinkedReference>[]);
return _references;
}
}
-class SdkBundleBuilder {
+abstract class _PrelinkedUnitMixin implements PrelinkedUnit {
+ @override
+ Map<String, Object> toMap() => {
+ "references": references,
+ };
+}
+
+class SdkBundleBuilder extends Object with _SdkBundleMixin implements SdkBundle {
bool _finished = false;
List<String> _prelinkedLibraryUris;
@@ -567,6 +605,9 @@ class SdkBundleBuilder {
SdkBundleBuilder();
+ @override
+ List<String> get prelinkedLibraryUris => _prelinkedLibraryUris ?? const <String>[];
+
/**
* The list of URIs of items in [prelinkedLibraries], e.g. `dart:core`.
*/
@@ -575,6 +616,9 @@ class SdkBundleBuilder {
_prelinkedLibraryUris = _value;
}
+ @override
+ List<PrelinkedLibrary> get prelinkedLibraries => _prelinkedLibraries ?? const <PrelinkedLibrary>[];
+
/**
* Pre-linked libraries.
*/
@@ -583,6 +627,9 @@ class SdkBundleBuilder {
_prelinkedLibraries = _value;
}
+ @override
+ List<String> get unlinkedUnitUris => _unlinkedUnitUris ?? const <String>[];
+
/**
* The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`.
*/
@@ -591,6 +638,9 @@ class SdkBundleBuilder {
_unlinkedUnitUris = _value;
}
+ @override
+ List<UnlinkedUnit> get unlinkedUnits => _unlinkedUnits ?? const <UnlinkedUnit>[];
+
/**
* Unlinked information for the compilation units constituting the SDK.
*/
@@ -686,7 +736,7 @@ class _SdkBundleReader extends fb.TableReader<_SdkBundleImpl> {
_SdkBundleImpl createObject(fb.BufferPointer bp) => new _SdkBundleImpl(bp);
}
-class _SdkBundleImpl implements SdkBundle {
+class _SdkBundleImpl extends Object with _SdkBundleMixin implements SdkBundle {
final fb.BufferPointer _bp;
_SdkBundleImpl(this._bp);
@@ -697,14 +747,6 @@ class _SdkBundleImpl implements SdkBundle {
List<UnlinkedUnit> _unlinkedUnits;
@override
- Map<String, Object> toMap() => {
- "prelinkedLibraryUris": prelinkedLibraryUris,
- "prelinkedLibraries": prelinkedLibraries,
- "unlinkedUnitUris": unlinkedUnitUris,
- "unlinkedUnits": unlinkedUnits,
- };
-
- @override
List<String> get prelinkedLibraryUris {
_prelinkedLibraryUris ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(_bp, 0, const <String>[]);
return _prelinkedLibraryUris;
@@ -729,7 +771,17 @@ class _SdkBundleImpl implements SdkBundle {
}
}
-class UnlinkedClassBuilder {
+abstract class _SdkBundleMixin implements SdkBundle {
+ @override
+ Map<String, Object> toMap() => {
+ "prelinkedLibraryUris": prelinkedLibraryUris,
+ "prelinkedLibraries": prelinkedLibraries,
+ "unlinkedUnitUris": unlinkedUnitUris,
+ "unlinkedUnits": unlinkedUnits,
+ };
+}
+
+class UnlinkedClassBuilder extends Object with _UnlinkedClassMixin implements UnlinkedClass {
bool _finished = false;
String _name;
@@ -747,6 +799,9 @@ class UnlinkedClassBuilder {
UnlinkedClassBuilder();
+ @override
+ String get name => _name ?? '';
+
/**
* Name of the class.
*/
@@ -755,6 +810,9 @@ class UnlinkedClassBuilder {
_name = _value;
}
+ @override
+ int get nameOffset => _nameOffset ?? 0;
+
/**
* Offset of the class name relative to the beginning of the file.
*/
@@ -763,6 +821,9 @@ class UnlinkedClassBuilder {
_nameOffset = _value;
}
+ @override
+ UnlinkedDocumentationComment get documentationComment => _documentationComment;
+
/**
* Documentation comment for the class, or `null` if there is no
* documentation comment.
@@ -772,6 +833,9 @@ class UnlinkedClassBuilder {
_documentationComment = _value;
}
+ @override
+ List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <UnlinkedTypeParam>[];
+
/**
* Type parameters of the class, if any.
*/
@@ -780,6 +844,9 @@ class UnlinkedClassBuilder {
_typeParameters = _value;
}
+ @override
+ UnlinkedTypeRef get supertype => _supertype;
+
/**
* Supertype of the class, or `null` if either (a) the class doesn't
* explicitly declare a supertype (and hence has supertype `Object`), or (b)
@@ -790,6 +857,9 @@ class UnlinkedClassBuilder {
_supertype = _value;
}
+ @override
+ List<UnlinkedTypeRef> get mixins => _mixins ?? const <UnlinkedTypeRef>[];
+
/**
* Mixins appearing in a `with` clause, if any.
*/
@@ -798,6 +868,9 @@ class UnlinkedClassBuilder {
_mixins = _value;
}
+ @override
+ List<UnlinkedTypeRef> get interfaces => _interfaces ?? const <UnlinkedTypeRef>[];
+
/**
* Interfaces appearing in an `implements` clause, if any.
*/
@@ -806,6 +879,9 @@ class UnlinkedClassBuilder {
_interfaces = _value;
}
+ @override
+ List<UnlinkedVariable> get fields => _fields ?? const <UnlinkedVariable>[];
+
/**
* Field declarations contained in the class.
*/
@@ -814,6 +890,9 @@ class UnlinkedClassBuilder {
_fields = _value;
}
+ @override
+ List<UnlinkedExecutable> get executables => _executables ?? const <UnlinkedExecutable>[];
+
/**
* Executable objects (methods, getters, and setters) contained in the class.
*/
@@ -822,6 +901,9 @@ class UnlinkedClassBuilder {
_executables = _value;
}
+ @override
+ bool get isAbstract => _isAbstract ?? false;
+
/**
* Indicates whether the class is declared with the `abstract` keyword.
*/
@@ -830,6 +912,9 @@ class UnlinkedClassBuilder {
_isAbstract = _value;
}
+ @override
+ bool get isMixinApplication => _isMixinApplication ?? false;
+
/**
* Indicates whether the class is declared using mixin application syntax.
*/
@@ -838,6 +923,9 @@ class UnlinkedClassBuilder {
_isMixinApplication = _value;
}
+ @override
+ bool get hasNoSupertype => _hasNoSupertype ?? false;
+
/**
* Indicates whether this class is the core "Object" class (and hence has no
* supertype)
@@ -1017,7 +1105,7 @@ class _UnlinkedClassReader extends fb.TableReader<_UnlinkedClassImpl> {
_UnlinkedClassImpl createObject(fb.BufferPointer bp) => new _UnlinkedClassImpl(bp);
}
-class _UnlinkedClassImpl implements UnlinkedClass {
+class _UnlinkedClassImpl extends Object with _UnlinkedClassMixin implements UnlinkedClass {
final fb.BufferPointer _bp;
_UnlinkedClassImpl(this._bp);
@@ -1036,22 +1124,6 @@ class _UnlinkedClassImpl implements UnlinkedClass {
bool _hasNoSupertype;
@override
- Map<String, Object> toMap() => {
- "name": name,
- "nameOffset": nameOffset,
- "documentationComment": documentationComment,
- "typeParameters": typeParameters,
- "supertype": supertype,
- "mixins": mixins,
- "interfaces": interfaces,
- "fields": fields,
- "executables": executables,
- "isAbstract": isAbstract,
- "isMixinApplication": isMixinApplication,
- "hasNoSupertype": hasNoSupertype,
- };
-
- @override
String get name {
_name ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _name;
@@ -1124,7 +1196,25 @@ class _UnlinkedClassImpl implements UnlinkedClass {
}
}
-class UnlinkedCombinatorBuilder {
+abstract class _UnlinkedClassMixin implements UnlinkedClass {
+ @override
+ Map<String, Object> toMap() => {
+ "name": name,
+ "nameOffset": nameOffset,
+ "documentationComment": documentationComment,
+ "typeParameters": typeParameters,
+ "supertype": supertype,
+ "mixins": mixins,
+ "interfaces": interfaces,
+ "fields": fields,
+ "executables": executables,
+ "isAbstract": isAbstract,
+ "isMixinApplication": isMixinApplication,
+ "hasNoSupertype": hasNoSupertype,
+ };
+}
+
+class UnlinkedCombinatorBuilder extends Object with _UnlinkedCombinatorMixin implements UnlinkedCombinator {
bool _finished = false;
List<String> _shows;
@@ -1132,6 +1222,9 @@ class UnlinkedCombinatorBuilder {
UnlinkedCombinatorBuilder();
+ @override
+ List<String> get shows => _shows ?? const <String>[];
+
/**
* List of names which are shown. Empty if this is a `hide` combinator.
*/
@@ -1140,6 +1233,9 @@ class UnlinkedCombinatorBuilder {
_shows = _value;
}
+ @override
+ List<String> get hides => _hides ?? const <String>[];
+
/**
* List of names which are hidden. Empty if this is a `show` combinator.
*/
@@ -1201,7 +1297,7 @@ class _UnlinkedCombinatorReader extends fb.TableReader<_UnlinkedCombinatorImpl>
_UnlinkedCombinatorImpl createObject(fb.BufferPointer bp) => new _UnlinkedCombinatorImpl(bp);
}
-class _UnlinkedCombinatorImpl implements UnlinkedCombinator {
+class _UnlinkedCombinatorImpl extends Object with _UnlinkedCombinatorMixin implements UnlinkedCombinator {
final fb.BufferPointer _bp;
_UnlinkedCombinatorImpl(this._bp);
@@ -1210,12 +1306,6 @@ class _UnlinkedCombinatorImpl implements UnlinkedCombinator {
List<String> _hides;
@override
- Map<String, Object> toMap() => {
- "shows": shows,
- "hides": hides,
- };
-
- @override
List<String> get shows {
_shows ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(_bp, 0, const <String>[]);
return _shows;
@@ -1228,7 +1318,15 @@ class _UnlinkedCombinatorImpl implements UnlinkedCombinator {
}
}
-class UnlinkedDocumentationCommentBuilder {
+abstract class _UnlinkedCombinatorMixin implements UnlinkedCombinator {
+ @override
+ Map<String, Object> toMap() => {
+ "shows": shows,
+ "hides": hides,
+ };
+}
+
+class UnlinkedDocumentationCommentBuilder extends Object with _UnlinkedDocumentationCommentMixin implements UnlinkedDocumentationComment {
bool _finished = false;
String _text;
@@ -1237,6 +1335,9 @@ class UnlinkedDocumentationCommentBuilder {
UnlinkedDocumentationCommentBuilder();
+ @override
+ String get text => _text ?? '';
+
/**
* Text of the documentation comment, with '\r\n' replaced by '\n'.
*
@@ -1248,6 +1349,9 @@ class UnlinkedDocumentationCommentBuilder {
_text = _value;
}
+ @override
+ int get offset => _offset ?? 0;
+
/**
* Offset of the beginning of the documentation comment relative to the
* beginning of the file.
@@ -1257,6 +1361,9 @@ class UnlinkedDocumentationCommentBuilder {
_offset = _value;
}
+ @override
+ int get length => _length ?? 0;
+
/**
* Length of the documentation comment (prior to replacing '\r\n' with '\n').
*/
@@ -1326,7 +1433,7 @@ class _UnlinkedDocumentationCommentReader extends fb.TableReader<_UnlinkedDocume
_UnlinkedDocumentationCommentImpl createObject(fb.BufferPointer bp) => new _UnlinkedDocumentationCommentImpl(bp);
}
-class _UnlinkedDocumentationCommentImpl implements UnlinkedDocumentationComment {
+class _UnlinkedDocumentationCommentImpl extends Object with _UnlinkedDocumentationCommentMixin implements UnlinkedDocumentationComment {
final fb.BufferPointer _bp;
_UnlinkedDocumentationCommentImpl(this._bp);
@@ -1336,13 +1443,6 @@ class _UnlinkedDocumentationCommentImpl implements UnlinkedDocumentationComment
int _length;
@override
- Map<String, Object> toMap() => {
- "text": text,
- "offset": offset,
- "length": length,
- };
-
- @override
String get text {
_text ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _text;
@@ -1361,7 +1461,16 @@ class _UnlinkedDocumentationCommentImpl implements UnlinkedDocumentationComment
}
}
-class UnlinkedEnumBuilder {
+abstract class _UnlinkedDocumentationCommentMixin implements UnlinkedDocumentationComment {
+ @override
+ Map<String, Object> toMap() => {
+ "text": text,
+ "offset": offset,
+ "length": length,
+ };
+}
+
+class UnlinkedEnumBuilder extends Object with _UnlinkedEnumMixin implements UnlinkedEnum {
bool _finished = false;
String _name;
@@ -1371,6 +1480,9 @@ class UnlinkedEnumBuilder {
UnlinkedEnumBuilder();
+ @override
+ String get name => _name ?? '';
+
/**
* Name of the enum type.
*/
@@ -1379,6 +1491,9 @@ class UnlinkedEnumBuilder {
_name = _value;
}
+ @override
+ int get nameOffset => _nameOffset ?? 0;
+
/**
* Offset of the enum name relative to the beginning of the file.
*/
@@ -1387,6 +1502,9 @@ class UnlinkedEnumBuilder {
_nameOffset = _value;
}
+ @override
+ UnlinkedDocumentationComment get documentationComment => _documentationComment;
+
/**
* Documentation comment for the enum, or `null` if there is no documentation
* comment.
@@ -1396,6 +1514,9 @@ class UnlinkedEnumBuilder {
_documentationComment = _value;
}
+ @override
+ List<UnlinkedEnumValue> get values => _values ?? const <UnlinkedEnumValue>[];
+
/**
* Values listed in the enum declaration, in declaration order.
*/
@@ -1479,7 +1600,7 @@ class _UnlinkedEnumReader extends fb.TableReader<_UnlinkedEnumImpl> {
_UnlinkedEnumImpl createObject(fb.BufferPointer bp) => new _UnlinkedEnumImpl(bp);
}
-class _UnlinkedEnumImpl implements UnlinkedEnum {
+class _UnlinkedEnumImpl extends Object with _UnlinkedEnumMixin implements UnlinkedEnum {
final fb.BufferPointer _bp;
_UnlinkedEnumImpl(this._bp);
@@ -1490,14 +1611,6 @@ class _UnlinkedEnumImpl implements UnlinkedEnum {
List<UnlinkedEnumValue> _values;
@override
- Map<String, Object> toMap() => {
- "name": name,
- "nameOffset": nameOffset,
- "documentationComment": documentationComment,
- "values": values,
- };
-
- @override
String get name {
_name ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _name;
@@ -1522,7 +1635,17 @@ class _UnlinkedEnumImpl implements UnlinkedEnum {
}
}
-class UnlinkedEnumValueBuilder {
+abstract class _UnlinkedEnumMixin implements UnlinkedEnum {
+ @override
+ Map<String, Object> toMap() => {
+ "name": name,
+ "nameOffset": nameOffset,
+ "documentationComment": documentationComment,
+ "values": values,
+ };
+}
+
+class UnlinkedEnumValueBuilder extends Object with _UnlinkedEnumValueMixin implements UnlinkedEnumValue {
bool _finished = false;
String _name;
@@ -1531,6 +1654,9 @@ class UnlinkedEnumValueBuilder {
UnlinkedEnumValueBuilder();
+ @override
+ String get name => _name ?? '';
+
/**
* Name of the enumerated value.
*/
@@ -1539,6 +1665,9 @@ class UnlinkedEnumValueBuilder {
_name = _value;
}
+ @override
+ int get nameOffset => _nameOffset ?? 0;
+
/**
* Offset of the enum value name relative to the beginning of the file.
*/
@@ -1547,6 +1676,9 @@ class UnlinkedEnumValueBuilder {
_nameOffset = _value;
}
+ @override
+ UnlinkedDocumentationComment get documentationComment => _documentationComment;
+
/**
* Documentation comment for the enum value, or `null` if there is no
* documentation comment.
@@ -1619,7 +1751,7 @@ class _UnlinkedEnumValueReader extends fb.TableReader<_UnlinkedEnumValueImpl> {
_UnlinkedEnumValueImpl createObject(fb.BufferPointer bp) => new _UnlinkedEnumValueImpl(bp);
}
-class _UnlinkedEnumValueImpl implements UnlinkedEnumValue {
+class _UnlinkedEnumValueImpl extends Object with _UnlinkedEnumValueMixin implements UnlinkedEnumValue {
final fb.BufferPointer _bp;
_UnlinkedEnumValueImpl(this._bp);
@@ -1629,13 +1761,6 @@ class _UnlinkedEnumValueImpl implements UnlinkedEnumValue {
UnlinkedDocumentationComment _documentationComment;
@override
- Map<String, Object> toMap() => {
- "name": name,
- "nameOffset": nameOffset,
- "documentationComment": documentationComment,
- };
-
- @override
String get name {
_name ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _name;
@@ -1654,7 +1779,16 @@ class _UnlinkedEnumValueImpl implements UnlinkedEnumValue {
}
}
-class UnlinkedExecutableBuilder {
+abstract class _UnlinkedEnumValueMixin implements UnlinkedEnumValue {
+ @override
+ Map<String, Object> toMap() => {
+ "name": name,
+ "nameOffset": nameOffset,
+ "documentationComment": documentationComment,
+ };
+}
+
+class UnlinkedExecutableBuilder extends Object with _UnlinkedExecutableMixin implements UnlinkedExecutable {
bool _finished = false;
String _name;
@@ -1673,6 +1807,9 @@ class UnlinkedExecutableBuilder {
UnlinkedExecutableBuilder();
+ @override
+ String get name => _name ?? '';
+
/**
* Name of the executable. For setters, this includes the trailing "=". For
* named constructors, this excludes the class name and excludes the ".".
@@ -1683,6 +1820,9 @@ class UnlinkedExecutableBuilder {
_name = _value;
}
+ @override
+ int get nameOffset => _nameOffset ?? 0;
+
/**
* Offset of the executable name relative to the beginning of the file. For
* named constructors, this excludes the class name and excludes the ".".
@@ -1694,6 +1834,9 @@ class UnlinkedExecutableBuilder {
_nameOffset = _value;
}
+ @override
+ UnlinkedDocumentationComment get documentationComment => _documentationComment;
+
/**
* Documentation comment for the executable, or `null` if there is no
* documentation comment.
@@ -1703,6 +1846,9 @@ class UnlinkedExecutableBuilder {
_documentationComment = _value;
}
+ @override
+ List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <UnlinkedTypeParam>[];
+
/**
* Type parameters of the executable, if any. Empty if support for generic
* method syntax is disabled.
@@ -1712,6 +1858,9 @@ class UnlinkedExecutableBuilder {
_typeParameters = _value;
}
+ @override
+ UnlinkedTypeRef get returnType => _returnType;
+
/**
* Declared return type of the executable. Absent if the return type is
* `void` or the executable is a constructor. Note that when strong mode is
@@ -1722,6 +1871,9 @@ class UnlinkedExecutableBuilder {
_returnType = _value;
}
+ @override
+ List<UnlinkedParam> get parameters => _parameters ?? const <UnlinkedParam>[];
+
/**
* Parameters of the executable, if any. Note that getters have no
* parameters (hence this will be the empty list), and setters have a single
@@ -1732,6 +1884,9 @@ class UnlinkedExecutableBuilder {
_parameters = _value;
}
+ @override
+ UnlinkedExecutableKind get kind => _kind ?? UnlinkedExecutableKind.functionOrMethod;
+
/**
* The kind of the executable (function/method, getter, setter, or
* constructor).
@@ -1741,6 +1896,9 @@ class UnlinkedExecutableBuilder {
_kind = _value;
}
+ @override
+ bool get isAbstract => _isAbstract ?? false;
+
/**
* Indicates whether the executable is declared using the `abstract` keyword.
*/
@@ -1749,6 +1907,9 @@ class UnlinkedExecutableBuilder {
_isAbstract = _value;
}
+ @override
+ bool get isStatic => _isStatic ?? false;
+
/**
* Indicates whether the executable is declared using the `static` keyword.
*
@@ -1761,6 +1922,9 @@ class UnlinkedExecutableBuilder {
_isStatic = _value;
}
+ @override
+ bool get isConst => _isConst ?? false;
+
/**
* Indicates whether the executable is declared using the `const` keyword.
*/
@@ -1769,6 +1933,9 @@ class UnlinkedExecutableBuilder {
_isConst = _value;
}
+ @override
+ bool get isFactory => _isFactory ?? false;
+
/**
* Indicates whether the executable is declared using the `factory` keyword.
*/
@@ -1777,6 +1944,9 @@ class UnlinkedExecutableBuilder {
_isFactory = _value;
}
+ @override
+ bool get hasImplicitReturnType => _hasImplicitReturnType ?? false;
+
/**
* Indicates whether the executable lacks an explicit return type
* declaration. False for constructors and setters.
@@ -1786,6 +1956,9 @@ class UnlinkedExecutableBuilder {
_hasImplicitReturnType = _value;
}
+ @override
+ bool get isExternal => _isExternal ?? false;
+
/**
* Indicates whether the executable is declared using the `external` keyword.
*/
@@ -1975,7 +2148,7 @@ class _UnlinkedExecutableReader extends fb.TableReader<_UnlinkedExecutableImpl>
_UnlinkedExecutableImpl createObject(fb.BufferPointer bp) => new _UnlinkedExecutableImpl(bp);
}
-class _UnlinkedExecutableImpl implements UnlinkedExecutable {
+class _UnlinkedExecutableImpl extends Object with _UnlinkedExecutableMixin implements UnlinkedExecutable {
final fb.BufferPointer _bp;
_UnlinkedExecutableImpl(this._bp);
@@ -1995,23 +2168,6 @@ class _UnlinkedExecutableImpl implements UnlinkedExecutable {
bool _isExternal;
@override
- Map<String, Object> toMap() => {
- "name": name,
- "nameOffset": nameOffset,
- "documentationComment": documentationComment,
- "typeParameters": typeParameters,
- "returnType": returnType,
- "parameters": parameters,
- "kind": kind,
- "isAbstract": isAbstract,
- "isStatic": isStatic,
- "isConst": isConst,
- "isFactory": isFactory,
- "hasImplicitReturnType": hasImplicitReturnType,
- "isExternal": isExternal,
- };
-
- @override
String get name {
_name ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _name;
@@ -2090,7 +2246,26 @@ class _UnlinkedExecutableImpl implements UnlinkedExecutable {
}
}
-class UnlinkedExportNonPublicBuilder {
+abstract class _UnlinkedExecutableMixin implements UnlinkedExecutable {
+ @override
+ Map<String, Object> toMap() => {
+ "name": name,
+ "nameOffset": nameOffset,
+ "documentationComment": documentationComment,
+ "typeParameters": typeParameters,
+ "returnType": returnType,
+ "parameters": parameters,
+ "kind": kind,
+ "isAbstract": isAbstract,
+ "isStatic": isStatic,
+ "isConst": isConst,
+ "isFactory": isFactory,
+ "hasImplicitReturnType": hasImplicitReturnType,
+ "isExternal": isExternal,
+ };
+}
+
+class UnlinkedExportNonPublicBuilder extends Object with _UnlinkedExportNonPublicMixin implements UnlinkedExportNonPublic {
bool _finished = false;
int _offset;
@@ -2099,6 +2274,9 @@ class UnlinkedExportNonPublicBuilder {
UnlinkedExportNonPublicBuilder();
+ @override
+ int get offset => _offset ?? 0;
+
/**
* Offset of the "export" keyword.
*/
@@ -2107,6 +2285,9 @@ class UnlinkedExportNonPublicBuilder {
_offset = _value;
}
+ @override
+ int get uriOffset => _uriOffset ?? 0;
+
/**
* Offset of the URI string (including quotes) relative to the beginning of
* the file.
@@ -2116,6 +2297,9 @@ class UnlinkedExportNonPublicBuilder {
_uriOffset = _value;
}
+ @override
+ int get uriEnd => _uriEnd ?? 0;
+
/**
* End of the URI string (including quotes) relative to the beginning of the
* file.
@@ -2181,7 +2365,7 @@ class _UnlinkedExportNonPublicReader extends fb.TableReader<_UnlinkedExportNonPu
_UnlinkedExportNonPublicImpl createObject(fb.BufferPointer bp) => new _UnlinkedExportNonPublicImpl(bp);
}
-class _UnlinkedExportNonPublicImpl implements UnlinkedExportNonPublic {
+class _UnlinkedExportNonPublicImpl extends Object with _UnlinkedExportNonPublicMixin implements UnlinkedExportNonPublic {
final fb.BufferPointer _bp;
_UnlinkedExportNonPublicImpl(this._bp);
@@ -2191,13 +2375,6 @@ class _UnlinkedExportNonPublicImpl implements UnlinkedExportNonPublic {
int _uriEnd;
@override
- Map<String, Object> toMap() => {
- "offset": offset,
- "uriOffset": uriOffset,
- "uriEnd": uriEnd,
- };
-
- @override
int get offset {
_offset ??= const fb.Int32Reader().vTableGet(_bp, 0, 0);
return _offset;
@@ -2216,7 +2393,16 @@ class _UnlinkedExportNonPublicImpl implements UnlinkedExportNonPublic {
}
}
-class UnlinkedExportPublicBuilder {
+abstract class _UnlinkedExportNonPublicMixin implements UnlinkedExportNonPublic {
+ @override
+ Map<String, Object> toMap() => {
+ "offset": offset,
+ "uriOffset": uriOffset,
+ "uriEnd": uriEnd,
+ };
+}
+
+class UnlinkedExportPublicBuilder extends Object with _UnlinkedExportPublicMixin implements UnlinkedExportPublic {
bool _finished = false;
String _uri;
@@ -2224,6 +2410,9 @@ class UnlinkedExportPublicBuilder {
UnlinkedExportPublicBuilder();
+ @override
+ String get uri => _uri ?? '';
+
/**
* URI used in the source code to reference the exported library.
*/
@@ -2232,6 +2421,9 @@ class UnlinkedExportPublicBuilder {
_uri = _value;
}
+ @override
+ List<UnlinkedCombinator> get combinators => _combinators ?? const <UnlinkedCombinator>[];
+
/**
* Combinators contained in this import declaration.
*/
@@ -2293,7 +2485,7 @@ class _UnlinkedExportPublicReader extends fb.TableReader<_UnlinkedExportPublicIm
_UnlinkedExportPublicImpl createObject(fb.BufferPointer bp) => new _UnlinkedExportPublicImpl(bp);
}
-class _UnlinkedExportPublicImpl implements UnlinkedExportPublic {
+class _UnlinkedExportPublicImpl extends Object with _UnlinkedExportPublicMixin implements UnlinkedExportPublic {
final fb.BufferPointer _bp;
_UnlinkedExportPublicImpl(this._bp);
@@ -2302,12 +2494,6 @@ class _UnlinkedExportPublicImpl implements UnlinkedExportPublic {
List<UnlinkedCombinator> _combinators;
@override
- Map<String, Object> toMap() => {
- "uri": uri,
- "combinators": combinators,
- };
-
- @override
String get uri {
_uri ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _uri;
@@ -2320,7 +2506,15 @@ class _UnlinkedExportPublicImpl implements UnlinkedExportPublic {
}
}
-class UnlinkedImportBuilder {
+abstract class _UnlinkedExportPublicMixin implements UnlinkedExportPublic {
+ @override
+ Map<String, Object> toMap() => {
+ "uri": uri,
+ "combinators": combinators,
+ };
+}
+
+class UnlinkedImportBuilder extends Object with _UnlinkedImportMixin implements UnlinkedImport {
bool _finished = false;
String _uri;
@@ -2335,6 +2529,9 @@ class UnlinkedImportBuilder {
UnlinkedImportBuilder();
+ @override
+ String get uri => _uri ?? '';
+
/**
* URI used in the source code to reference the imported library.
*/
@@ -2343,6 +2540,9 @@ class UnlinkedImportBuilder {
_uri = _value;
}
+ @override
+ int get offset => _offset ?? 0;
+
/**
* If [isImplicit] is false, offset of the "import" keyword. If [isImplicit]
* is true, zero.
@@ -2352,6 +2552,9 @@ class UnlinkedImportBuilder {
_offset = _value;
}
+ @override
+ int get prefixReference => _prefixReference ?? 0;
+
/**
* Index into [UnlinkedUnit.references] of the prefix declared by this
* import declaration, or zero if this import declaration declares no prefix.
@@ -2363,6 +2566,9 @@ class UnlinkedImportBuilder {
_prefixReference = _value;
}
+ @override
+ List<UnlinkedCombinator> get combinators => _combinators ?? const <UnlinkedCombinator>[];
+
/**
* Combinators contained in this import declaration.
*/
@@ -2371,6 +2577,9 @@ class UnlinkedImportBuilder {
_combinators = _value;
}
+ @override
+ bool get isDeferred => _isDeferred ?? false;
+
/**
* Indicates whether the import declaration uses the `deferred` keyword.
*/
@@ -2379,6 +2588,9 @@ class UnlinkedImportBuilder {
_isDeferred = _value;
}
+ @override
+ bool get isImplicit => _isImplicit ?? false;
+
/**
* Indicates whether the import declaration is implicit.
*/
@@ -2387,6 +2599,9 @@ class UnlinkedImportBuilder {
_isImplicit = _value;
}
+ @override
+ int get uriOffset => _uriOffset ?? 0;
+
/**
* Offset of the URI string (including quotes) relative to the beginning of
* the file. If [isImplicit] is true, zero.
@@ -2396,6 +2611,9 @@ class UnlinkedImportBuilder {
_uriOffset = _value;
}
+ @override
+ int get uriEnd => _uriEnd ?? 0;
+
/**
* End of the URI string (including quotes) relative to the beginning of the
* file. If [isImplicit] is true, zero.
@@ -2405,6 +2623,9 @@ class UnlinkedImportBuilder {
_uriEnd = _value;
}
+ @override
+ int get prefixOffset => _prefixOffset ?? 0;
+
/**
* Offset of the prefix name relative to the beginning of the file, or zero
* if there is no prefix.
@@ -2536,7 +2757,7 @@ class _UnlinkedImportReader extends fb.TableReader<_UnlinkedImportImpl> {
_UnlinkedImportImpl createObject(fb.BufferPointer bp) => new _UnlinkedImportImpl(bp);
}
-class _UnlinkedImportImpl implements UnlinkedImport {
+class _UnlinkedImportImpl extends Object with _UnlinkedImportMixin implements UnlinkedImport {
final fb.BufferPointer _bp;
_UnlinkedImportImpl(this._bp);
@@ -2552,19 +2773,6 @@ class _UnlinkedImportImpl implements UnlinkedImport {
int _prefixOffset;
@override
- Map<String, Object> toMap() => {
- "uri": uri,
- "offset": offset,
- "prefixReference": prefixReference,
- "combinators": combinators,
- "isDeferred": isDeferred,
- "isImplicit": isImplicit,
- "uriOffset": uriOffset,
- "uriEnd": uriEnd,
- "prefixOffset": prefixOffset,
- };
-
- @override
String get uri {
_uri ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _uri;
@@ -2619,7 +2827,22 @@ class _UnlinkedImportImpl implements UnlinkedImport {
}
}
-class UnlinkedParamBuilder {
+abstract class _UnlinkedImportMixin implements UnlinkedImport {
+ @override
+ Map<String, Object> toMap() => {
+ "uri": uri,
+ "offset": offset,
+ "prefixReference": prefixReference,
+ "combinators": combinators,
+ "isDeferred": isDeferred,
+ "isImplicit": isImplicit,
+ "uriOffset": uriOffset,
+ "uriEnd": uriEnd,
+ "prefixOffset": prefixOffset,
+ };
+}
+
+class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements UnlinkedParam {
bool _finished = false;
String _name;
@@ -2633,6 +2856,9 @@ class UnlinkedParamBuilder {
UnlinkedParamBuilder();
+ @override
+ String get name => _name ?? '';
+
/**
* Name of the parameter.
*/
@@ -2641,6 +2867,9 @@ class UnlinkedParamBuilder {
_name = _value;
}
+ @override
+ int get nameOffset => _nameOffset ?? 0;
+
/**
* Offset of the parameter name relative to the beginning of the file.
*/
@@ -2649,6 +2878,9 @@ class UnlinkedParamBuilder {
_nameOffset = _value;
}
+ @override
+ UnlinkedTypeRef get type => _type;
+
/**
* If [isFunctionTyped] is `true`, the declared return type. If
* [isFunctionTyped] is `false`, the declared type. Absent if
@@ -2661,6 +2893,9 @@ class UnlinkedParamBuilder {
_type = _value;
}
+ @override
+ List<UnlinkedParam> get parameters => _parameters ?? const <UnlinkedParam>[];
+
/**
* If [isFunctionTyped] is `true`, the parameters of the function type.
*/
@@ -2669,6 +2904,9 @@ class UnlinkedParamBuilder {
_parameters = _value;
}
+ @override
+ UnlinkedParamKind get kind => _kind ?? UnlinkedParamKind.required;
+
/**
* Kind of the parameter.
*/
@@ -2677,6 +2915,9 @@ class UnlinkedParamBuilder {
_kind = _value;
}
+ @override
+ bool get isFunctionTyped => _isFunctionTyped ?? false;
+
/**
* Indicates whether this is a function-typed parameter.
*/
@@ -2685,6 +2926,9 @@ class UnlinkedParamBuilder {
_isFunctionTyped = _value;
}
+ @override
+ bool get isInitializingFormal => _isInitializingFormal ?? false;
+
/**
* Indicates whether this is an initializing formal parameter (i.e. it is
* declared using `this.` syntax).
@@ -2694,6 +2938,9 @@ class UnlinkedParamBuilder {
_isInitializingFormal = _value;
}
+ @override
+ bool get hasImplicitType => _hasImplicitType ?? false;
+
/**
* Indicates whether this parameter lacks an explicit type declaration.
* Always false for a function-typed parameter.
@@ -2819,7 +3066,7 @@ class _UnlinkedParamReader extends fb.TableReader<_UnlinkedParamImpl> {
_UnlinkedParamImpl createObject(fb.BufferPointer bp) => new _UnlinkedParamImpl(bp);
}
-class _UnlinkedParamImpl implements UnlinkedParam {
+class _UnlinkedParamImpl extends Object with _UnlinkedParamMixin implements UnlinkedParam {
final fb.BufferPointer _bp;
_UnlinkedParamImpl(this._bp);
@@ -2834,18 +3081,6 @@ class _UnlinkedParamImpl implements UnlinkedParam {
bool _hasImplicitType;
@override
- Map<String, Object> toMap() => {
- "name": name,
- "nameOffset": nameOffset,
- "type": type,
- "parameters": parameters,
- "kind": kind,
- "isFunctionTyped": isFunctionTyped,
- "isInitializingFormal": isInitializingFormal,
- "hasImplicitType": hasImplicitType,
- };
-
- @override
String get name {
_name ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _name;
@@ -2894,7 +3129,21 @@ class _UnlinkedParamImpl implements UnlinkedParam {
}
}
-class UnlinkedPartBuilder {
+abstract class _UnlinkedParamMixin implements UnlinkedParam {
+ @override
+ Map<String, Object> toMap() => {
+ "name": name,
+ "nameOffset": nameOffset,
+ "type": type,
+ "parameters": parameters,
+ "kind": kind,
+ "isFunctionTyped": isFunctionTyped,
+ "isInitializingFormal": isInitializingFormal,
+ "hasImplicitType": hasImplicitType,
+ };
+}
+
+class UnlinkedPartBuilder extends Object with _UnlinkedPartMixin implements UnlinkedPart {
bool _finished = false;
int _uriOffset;
@@ -2902,6 +3151,9 @@ class UnlinkedPartBuilder {
UnlinkedPartBuilder();
+ @override
+ int get uriOffset => _uriOffset ?? 0;
+
/**
* Offset of the URI string (including quotes) relative to the beginning of
* the file.
@@ -2911,6 +3163,9 @@ class UnlinkedPartBuilder {
_uriOffset = _value;
}
+ @override
+ int get uriEnd => _uriEnd ?? 0;
+
/**
* End of the URI string (including quotes) relative to the beginning of the
* file.
@@ -2966,7 +3221,7 @@ class _UnlinkedPartReader extends fb.TableReader<_UnlinkedPartImpl> {
_UnlinkedPartImpl createObject(fb.BufferPointer bp) => new _UnlinkedPartImpl(bp);
}
-class _UnlinkedPartImpl implements UnlinkedPart {
+class _UnlinkedPartImpl extends Object with _UnlinkedPartMixin implements UnlinkedPart {
final fb.BufferPointer _bp;
_UnlinkedPartImpl(this._bp);
@@ -2975,12 +3230,6 @@ class _UnlinkedPartImpl implements UnlinkedPart {
int _uriEnd;
@override
- Map<String, Object> toMap() => {
- "uriOffset": uriOffset,
- "uriEnd": uriEnd,
- };
-
- @override
int get uriOffset {
_uriOffset ??= const fb.Int32Reader().vTableGet(_bp, 0, 0);
return _uriOffset;
@@ -2993,7 +3242,15 @@ class _UnlinkedPartImpl implements UnlinkedPart {
}
}
-class UnlinkedPublicNameBuilder {
+abstract class _UnlinkedPartMixin implements UnlinkedPart {
+ @override
+ Map<String, Object> toMap() => {
+ "uriOffset": uriOffset,
+ "uriEnd": uriEnd,
+ };
+}
+
+class UnlinkedPublicNameBuilder extends Object with _UnlinkedPublicNameMixin implements UnlinkedPublicName {
bool _finished = false;
String _name;
@@ -3002,6 +3259,9 @@ class UnlinkedPublicNameBuilder {
UnlinkedPublicNameBuilder();
+ @override
+ String get name => _name ?? '';
+
/**
* The name itself.
*/
@@ -3010,6 +3270,9 @@ class UnlinkedPublicNameBuilder {
_name = _value;
}
+ @override
+ PrelinkedReferenceKind get kind => _kind ?? PrelinkedReferenceKind.classOrEnum;
+
/**
* The kind of object referred to by the name.
*/
@@ -3018,6 +3281,9 @@ class UnlinkedPublicNameBuilder {
_kind = _value;
}
+ @override
+ int get numTypeParameters => _numTypeParameters ?? 0;
+
/**
* If the entity being referred to is generic, the number of type parameters
* it accepts. Otherwise zero.
@@ -3096,7 +3362,7 @@ class _UnlinkedPublicNameReader extends fb.TableReader<_UnlinkedPublicNameImpl>
_UnlinkedPublicNameImpl createObject(fb.BufferPointer bp) => new _UnlinkedPublicNameImpl(bp);
}
-class _UnlinkedPublicNameImpl implements UnlinkedPublicName {
+class _UnlinkedPublicNameImpl extends Object with _UnlinkedPublicNameMixin implements UnlinkedPublicName {
final fb.BufferPointer _bp;
_UnlinkedPublicNameImpl(this._bp);
@@ -3106,13 +3372,6 @@ class _UnlinkedPublicNameImpl implements UnlinkedPublicName {
int _numTypeParameters;
@override
- Map<String, Object> toMap() => {
- "name": name,
- "kind": kind,
- "numTypeParameters": numTypeParameters,
- };
-
- @override
String get name {
_name ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _name;
@@ -3131,7 +3390,16 @@ class _UnlinkedPublicNameImpl implements UnlinkedPublicName {
}
}
-class UnlinkedPublicNamespaceBuilder {
+abstract class _UnlinkedPublicNameMixin implements UnlinkedPublicName {
+ @override
+ Map<String, Object> toMap() => {
+ "name": name,
+ "kind": kind,
+ "numTypeParameters": numTypeParameters,
+ };
+}
+
+class UnlinkedPublicNamespaceBuilder extends Object with _UnlinkedPublicNamespaceMixin implements UnlinkedPublicNamespace {
bool _finished = false;
List<UnlinkedPublicNameBuilder> _names;
@@ -3140,6 +3408,9 @@ class UnlinkedPublicNamespaceBuilder {
UnlinkedPublicNamespaceBuilder();
+ @override
+ List<UnlinkedPublicName> get names => _names ?? const <UnlinkedPublicName>[];
+
/**
* Public names defined in the compilation unit.
*
@@ -3151,6 +3422,9 @@ class UnlinkedPublicNamespaceBuilder {
_names = _value;
}
+ @override
+ List<UnlinkedExportPublic> get exports => _exports ?? const <UnlinkedExportPublic>[];
+
/**
* Export declarations in the compilation unit.
*/
@@ -3159,6 +3433,9 @@ class UnlinkedPublicNamespaceBuilder {
_exports = _value;
}
+ @override
+ List<String> get parts => _parts ?? const <String>[];
+
/**
* URIs referenced by part declarations in the compilation unit.
*/
@@ -3246,7 +3523,7 @@ class _UnlinkedPublicNamespaceReader extends fb.TableReader<_UnlinkedPublicNames
_UnlinkedPublicNamespaceImpl createObject(fb.BufferPointer bp) => new _UnlinkedPublicNamespaceImpl(bp);
}
-class _UnlinkedPublicNamespaceImpl implements UnlinkedPublicNamespace {
+class _UnlinkedPublicNamespaceImpl extends Object with _UnlinkedPublicNamespaceMixin implements UnlinkedPublicNamespace {
final fb.BufferPointer _bp;
_UnlinkedPublicNamespaceImpl(this._bp);
@@ -3256,13 +3533,6 @@ class _UnlinkedPublicNamespaceImpl implements UnlinkedPublicNamespace {
List<String> _parts;
@override
- Map<String, Object> toMap() => {
- "names": names,
- "exports": exports,
- "parts": parts,
- };
-
- @override
List<UnlinkedPublicName> get names {
_names ??= const fb.ListReader<UnlinkedPublicName>(const _UnlinkedPublicNameReader()).vTableGet(_bp, 0, const <UnlinkedPublicName>[]);
return _names;
@@ -3281,7 +3551,16 @@ class _UnlinkedPublicNamespaceImpl implements UnlinkedPublicNamespace {
}
}
-class UnlinkedReferenceBuilder {
+abstract class _UnlinkedPublicNamespaceMixin implements UnlinkedPublicNamespace {
+ @override
+ Map<String, Object> toMap() => {
+ "names": names,
+ "exports": exports,
+ "parts": parts,
+ };
+}
+
+class UnlinkedReferenceBuilder extends Object with _UnlinkedReferenceMixin implements UnlinkedReference {
bool _finished = false;
String _name;
@@ -3289,6 +3568,9 @@ class UnlinkedReferenceBuilder {
UnlinkedReferenceBuilder();
+ @override
+ String get name => _name ?? '';
+
/**
* Name of the entity being referred to. The empty string refers to the
* pseudo-type `dynamic`.
@@ -3298,6 +3580,9 @@ class UnlinkedReferenceBuilder {
_name = _value;
}
+ @override
+ int get prefixReference => _prefixReference ?? 0;
+
/**
* Prefix used to refer to the entity, or zero if no prefix is used. This is
* an index into [UnlinkedUnit.references].
@@ -3366,7 +3651,7 @@ class _UnlinkedReferenceReader extends fb.TableReader<_UnlinkedReferenceImpl> {
_UnlinkedReferenceImpl createObject(fb.BufferPointer bp) => new _UnlinkedReferenceImpl(bp);
}
-class _UnlinkedReferenceImpl implements UnlinkedReference {
+class _UnlinkedReferenceImpl extends Object with _UnlinkedReferenceMixin implements UnlinkedReference {
final fb.BufferPointer _bp;
_UnlinkedReferenceImpl(this._bp);
@@ -3375,12 +3660,6 @@ class _UnlinkedReferenceImpl implements UnlinkedReference {
int _prefixReference;
@override
- Map<String, Object> toMap() => {
- "name": name,
- "prefixReference": prefixReference,
- };
-
- @override
String get name {
_name ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _name;
@@ -3393,7 +3672,15 @@ class _UnlinkedReferenceImpl implements UnlinkedReference {
}
}
-class UnlinkedTypedefBuilder {
+abstract class _UnlinkedReferenceMixin implements UnlinkedReference {
+ @override
+ Map<String, Object> toMap() => {
+ "name": name,
+ "prefixReference": prefixReference,
+ };
+}
+
+class UnlinkedTypedefBuilder extends Object with _UnlinkedTypedefMixin implements UnlinkedTypedef {
bool _finished = false;
String _name;
@@ -3405,6 +3692,9 @@ class UnlinkedTypedefBuilder {
UnlinkedTypedefBuilder();
+ @override
+ String get name => _name ?? '';
+
/**
* Name of the typedef.
*/
@@ -3413,6 +3703,9 @@ class UnlinkedTypedefBuilder {
_name = _value;
}
+ @override
+ int get nameOffset => _nameOffset ?? 0;
+
/**
* Offset of the typedef name relative to the beginning of the file.
*/
@@ -3421,6 +3714,9 @@ class UnlinkedTypedefBuilder {
_nameOffset = _value;
}
+ @override
+ UnlinkedDocumentationComment get documentationComment => _documentationComment;
+
/**
* Documentation comment for the typedef, or `null` if there is no
* documentation comment.
@@ -3430,6 +3726,9 @@ class UnlinkedTypedefBuilder {
_documentationComment = _value;
}
+ @override
+ List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <UnlinkedTypeParam>[];
+
/**
* Type parameters of the typedef, if any.
*/
@@ -3438,6 +3737,9 @@ class UnlinkedTypedefBuilder {
_typeParameters = _value;
}
+ @override
+ UnlinkedTypeRef get returnType => _returnType;
+
/**
* Return type of the typedef. Absent if the return type is `void`.
*/
@@ -3446,6 +3748,9 @@ class UnlinkedTypedefBuilder {
_returnType = _value;
}
+ @override
+ List<UnlinkedParam> get parameters => _parameters ?? const <UnlinkedParam>[];
+
/**
* Parameters of the executable, if any.
*/
@@ -3555,7 +3860,7 @@ class _UnlinkedTypedefReader extends fb.TableReader<_UnlinkedTypedefImpl> {
_UnlinkedTypedefImpl createObject(fb.BufferPointer bp) => new _UnlinkedTypedefImpl(bp);
}
-class _UnlinkedTypedefImpl implements UnlinkedTypedef {
+class _UnlinkedTypedefImpl extends Object with _UnlinkedTypedefMixin implements UnlinkedTypedef {
final fb.BufferPointer _bp;
_UnlinkedTypedefImpl(this._bp);
@@ -3568,16 +3873,6 @@ class _UnlinkedTypedefImpl implements UnlinkedTypedef {
List<UnlinkedParam> _parameters;
@override
- Map<String, Object> toMap() => {
- "name": name,
- "nameOffset": nameOffset,
- "documentationComment": documentationComment,
- "typeParameters": typeParameters,
- "returnType": returnType,
- "parameters": parameters,
- };
-
- @override
String get name {
_name ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _name;
@@ -3614,7 +3909,19 @@ class _UnlinkedTypedefImpl implements UnlinkedTypedef {
}
}
-class UnlinkedTypeParamBuilder {
+abstract class _UnlinkedTypedefMixin implements UnlinkedTypedef {
+ @override
+ Map<String, Object> toMap() => {
+ "name": name,
+ "nameOffset": nameOffset,
+ "documentationComment": documentationComment,
+ "typeParameters": typeParameters,
+ "returnType": returnType,
+ "parameters": parameters,
+ };
+}
+
+class UnlinkedTypeParamBuilder extends Object with _UnlinkedTypeParamMixin implements UnlinkedTypeParam {
bool _finished = false;
String _name;
@@ -3623,6 +3930,9 @@ class UnlinkedTypeParamBuilder {
UnlinkedTypeParamBuilder();
+ @override
+ String get name => _name ?? '';
+
/**
* Name of the type parameter.
*/
@@ -3631,6 +3941,9 @@ class UnlinkedTypeParamBuilder {
_name = _value;
}
+ @override
+ int get nameOffset => _nameOffset ?? 0;
+
/**
* Offset of the type parameter name relative to the beginning of the file.
*/
@@ -3639,6 +3952,9 @@ class UnlinkedTypeParamBuilder {
_nameOffset = _value;
}
+ @override
+ UnlinkedTypeRef get bound => _bound;
+
/**
* Bound of the type parameter, if a bound is explicitly declared. Otherwise
* null.
@@ -3710,7 +4026,7 @@ class _UnlinkedTypeParamReader extends fb.TableReader<_UnlinkedTypeParamImpl> {
_UnlinkedTypeParamImpl createObject(fb.BufferPointer bp) => new _UnlinkedTypeParamImpl(bp);
}
-class _UnlinkedTypeParamImpl implements UnlinkedTypeParam {
+class _UnlinkedTypeParamImpl extends Object with _UnlinkedTypeParamMixin implements UnlinkedTypeParam {
final fb.BufferPointer _bp;
_UnlinkedTypeParamImpl(this._bp);
@@ -3720,13 +4036,6 @@ class _UnlinkedTypeParamImpl implements UnlinkedTypeParam {
UnlinkedTypeRef _bound;
@override
- Map<String, Object> toMap() => {
- "name": name,
- "nameOffset": nameOffset,
- "bound": bound,
- };
-
- @override
String get name {
_name ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _name;
@@ -3745,7 +4054,16 @@ class _UnlinkedTypeParamImpl implements UnlinkedTypeParam {
}
}
-class UnlinkedTypeRefBuilder {
+abstract class _UnlinkedTypeParamMixin implements UnlinkedTypeParam {
+ @override
+ Map<String, Object> toMap() => {
+ "name": name,
+ "nameOffset": nameOffset,
+ "bound": bound,
+ };
+}
+
+class UnlinkedTypeRefBuilder extends Object with _UnlinkedTypeRefMixin implements UnlinkedTypeRef {
bool _finished = false;
int _reference;
@@ -3754,6 +4072,9 @@ class UnlinkedTypeRefBuilder {
UnlinkedTypeRefBuilder();
+ @override
+ int get reference => _reference ?? 0;
+
/**
* Index into [UnlinkedUnit.references] for the type being referred to, or
* zero if this is a reference to a type parameter.
@@ -3769,6 +4090,9 @@ class UnlinkedTypeRefBuilder {
_reference = _value;
}
+ @override
+ int get paramReference => _paramReference ?? 0;
+
/**
* If this is a reference to a type parameter, one-based index into the list
* of [UnlinkedTypeParam]s currently in effect. Indexing is done using De
@@ -3793,6 +4117,9 @@ class UnlinkedTypeRefBuilder {
_paramReference = _value;
}
+ @override
+ List<UnlinkedTypeRef> get typeArguments => _typeArguments ?? const <UnlinkedTypeRef>[];
+
/**
* If this is an instantiation of a generic type, the type arguments used to
* instantiate it. Trailing type arguments of type `dynamic` are omitted.
@@ -3883,7 +4210,7 @@ class _UnlinkedTypeRefReader extends fb.TableReader<_UnlinkedTypeRefImpl> {
_UnlinkedTypeRefImpl createObject(fb.BufferPointer bp) => new _UnlinkedTypeRefImpl(bp);
}
-class _UnlinkedTypeRefImpl implements UnlinkedTypeRef {
+class _UnlinkedTypeRefImpl extends Object with _UnlinkedTypeRefMixin implements UnlinkedTypeRef {
final fb.BufferPointer _bp;
_UnlinkedTypeRefImpl(this._bp);
@@ -3893,13 +4220,6 @@ class _UnlinkedTypeRefImpl implements UnlinkedTypeRef {
List<UnlinkedTypeRef> _typeArguments;
@override
- Map<String, Object> toMap() => {
- "reference": reference,
- "paramReference": paramReference,
- "typeArguments": typeArguments,
- };
-
- @override
int get reference {
_reference ??= const fb.Int32Reader().vTableGet(_bp, 0, 0);
return _reference;
@@ -3918,7 +4238,16 @@ class _UnlinkedTypeRefImpl implements UnlinkedTypeRef {
}
}
-class UnlinkedUnitBuilder {
+abstract class _UnlinkedTypeRefMixin implements UnlinkedTypeRef {
+ @override
+ Map<String, Object> toMap() => {
+ "reference": reference,
+ "paramReference": paramReference,
+ "typeArguments": typeArguments,
+ };
+}
+
+class UnlinkedUnitBuilder extends Object with _UnlinkedUnitMixin implements UnlinkedUnit {
bool _finished = false;
String _libraryName;
@@ -3938,6 +4267,9 @@ class UnlinkedUnitBuilder {
UnlinkedUnitBuilder();
+ @override
+ String get libraryName => _libraryName ?? '';
+
/**
* Name of the library (from a "library" declaration, if present).
*/
@@ -3946,6 +4278,9 @@ class UnlinkedUnitBuilder {
_libraryName = _value;
}
+ @override
+ int get libraryNameOffset => _libraryNameOffset ?? 0;
+
/**
* Offset of the library name relative to the beginning of the file (or 0 if
* the library has no name).
@@ -3955,6 +4290,9 @@ class UnlinkedUnitBuilder {
_libraryNameOffset = _value;
}
+ @override
+ int get libraryNameLength => _libraryNameLength ?? 0;
+
/**
* Length of the library name as it appears in the source code (or 0 if the
* library has no name).
@@ -3964,6 +4302,9 @@ class UnlinkedUnitBuilder {
_libraryNameLength = _value;
}
+ @override
+ UnlinkedDocumentationComment get libraryDocumentationComment => _libraryDocumentationComment;
+
/**
* Documentation comment for the library, or `null` if there is no
* documentation comment.
@@ -3973,6 +4314,9 @@ class UnlinkedUnitBuilder {
_libraryDocumentationComment = _value;
}
+ @override
+ UnlinkedPublicNamespace get publicNamespace => _publicNamespace;
+
/**
* Unlinked public namespace of this compilation unit.
*/
@@ -3981,6 +4325,9 @@ class UnlinkedUnitBuilder {
_publicNamespace = _value;
}
+ @override
+ List<UnlinkedReference> get references => _references ?? const <UnlinkedReference>[];
+
/**
* Top level and prefixed names referred to by this compilation unit. The
* zeroth element of this array is always populated and always represents a
@@ -3991,6 +4338,9 @@ class UnlinkedUnitBuilder {
_references = _value;
}
+ @override
+ List<UnlinkedClass> get classes => _classes ?? const <UnlinkedClass>[];
+
/**
* Classes declared in the compilation unit.
*/
@@ -3999,6 +4349,9 @@ class UnlinkedUnitBuilder {
_classes = _value;
}
+ @override
+ List<UnlinkedEnum> get enums => _enums ?? const <UnlinkedEnum>[];
+
/**
* Enums declared in the compilation unit.
*/
@@ -4007,6 +4360,9 @@ class UnlinkedUnitBuilder {
_enums = _value;
}
+ @override
+ List<UnlinkedExecutable> get executables => _executables ?? const <UnlinkedExecutable>[];
+
/**
* Top level executable objects (functions, getters, and setters) declared in
* the compilation unit.
@@ -4016,6 +4372,9 @@ class UnlinkedUnitBuilder {
_executables = _value;
}
+ @override
+ List<UnlinkedExportNonPublic> get exports => _exports ?? const <UnlinkedExportNonPublic>[];
+
/**
* Export declarations in the compilation unit.
*/
@@ -4024,6 +4383,9 @@ class UnlinkedUnitBuilder {
_exports = _value;
}
+ @override
+ List<UnlinkedImport> get imports => _imports ?? const <UnlinkedImport>[];
+
/**
* Import declarations in the compilation unit.
*/
@@ -4032,6 +4394,9 @@ class UnlinkedUnitBuilder {
_imports = _value;
}
+ @override
+ List<UnlinkedPart> get parts => _parts ?? const <UnlinkedPart>[];
+
/**
* Part declarations in the compilation unit.
*/
@@ -4040,6 +4405,9 @@ class UnlinkedUnitBuilder {
_parts = _value;
}
+ @override
+ List<UnlinkedTypedef> get typedefs => _typedefs ?? const <UnlinkedTypedef>[];
+
/**
* Typedefs declared in the compilation unit.
*/
@@ -4048,6 +4416,9 @@ class UnlinkedUnitBuilder {
_typedefs = _value;
}
+ @override
+ List<UnlinkedVariable> get variables => _variables ?? const <UnlinkedVariable>[];
+
/**
* Top level variables declared in the compilation unit.
*/
@@ -4271,7 +4642,7 @@ class _UnlinkedUnitReader extends fb.TableReader<_UnlinkedUnitImpl> {
_UnlinkedUnitImpl createObject(fb.BufferPointer bp) => new _UnlinkedUnitImpl(bp);
}
-class _UnlinkedUnitImpl implements UnlinkedUnit {
+class _UnlinkedUnitImpl extends Object with _UnlinkedUnitMixin implements UnlinkedUnit {
final fb.BufferPointer _bp;
_UnlinkedUnitImpl(this._bp);
@@ -4292,24 +4663,6 @@ class _UnlinkedUnitImpl implements UnlinkedUnit {
List<UnlinkedVariable> _variables;
@override
- Map<String, Object> toMap() => {
- "libraryName": libraryName,
- "libraryNameOffset": libraryNameOffset,
- "libraryNameLength": libraryNameLength,
- "libraryDocumentationComment": libraryDocumentationComment,
- "publicNamespace": publicNamespace,
- "references": references,
- "classes": classes,
- "enums": enums,
- "executables": executables,
- "exports": exports,
- "imports": imports,
- "parts": parts,
- "typedefs": typedefs,
- "variables": variables,
- };
-
- @override
String get libraryName {
_libraryName ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _libraryName;
@@ -4394,7 +4747,27 @@ class _UnlinkedUnitImpl implements UnlinkedUnit {
}
}
-class UnlinkedVariableBuilder {
+abstract class _UnlinkedUnitMixin implements UnlinkedUnit {
+ @override
+ Map<String, Object> toMap() => {
+ "libraryName": libraryName,
+ "libraryNameOffset": libraryNameOffset,
+ "libraryNameLength": libraryNameLength,
+ "libraryDocumentationComment": libraryDocumentationComment,
+ "publicNamespace": publicNamespace,
+ "references": references,
+ "classes": classes,
+ "enums": enums,
+ "executables": executables,
+ "exports": exports,
+ "imports": imports,
+ "parts": parts,
+ "typedefs": typedefs,
+ "variables": variables,
+ };
+}
+
+class UnlinkedVariableBuilder extends Object with _UnlinkedVariableMixin implements UnlinkedVariable {
bool _finished = false;
String _name;
@@ -4408,6 +4781,9 @@ class UnlinkedVariableBuilder {
UnlinkedVariableBuilder();
+ @override
+ String get name => _name ?? '';
+
/**
* Name of the variable.
*/
@@ -4416,6 +4792,9 @@ class UnlinkedVariableBuilder {
_name = _value;
}
+ @override
+ int get nameOffset => _nameOffset ?? 0;
+
/**
* Offset of the variable name relative to the beginning of the file.
*/
@@ -4424,6 +4803,9 @@ class UnlinkedVariableBuilder {
_nameOffset = _value;
}
+ @override
+ UnlinkedDocumentationComment get documentationComment => _documentationComment;
+
/**
* Documentation comment for the variable, or `null` if there is no
* documentation comment.
@@ -4433,6 +4815,9 @@ class UnlinkedVariableBuilder {
_documentationComment = _value;
}
+ @override
+ UnlinkedTypeRef get type => _type;
+
/**
* Declared type of the variable. Note that when strong mode is enabled, the
* actual type of the variable may be different due to type inference.
@@ -4442,6 +4827,9 @@ class UnlinkedVariableBuilder {
_type = _value;
}
+ @override
+ bool get isStatic => _isStatic ?? false;
+
/**
* Indicates whether the variable is declared using the `static` keyword.
*
@@ -4454,6 +4842,9 @@ class UnlinkedVariableBuilder {
_isStatic = _value;
}
+ @override
+ bool get isFinal => _isFinal ?? false;
+
/**
* Indicates whether the variable is declared using the `final` keyword.
*/
@@ -4462,6 +4853,9 @@ class UnlinkedVariableBuilder {
_isFinal = _value;
}
+ @override
+ bool get isConst => _isConst ?? false;
+
/**
* Indicates whether the variable is declared using the `const` keyword.
*/
@@ -4470,6 +4864,9 @@ class UnlinkedVariableBuilder {
_isConst = _value;
}
+ @override
+ bool get hasImplicitType => _hasImplicitType ?? false;
+
/**
* Indicates whether this variable lacks an explicit type declaration.
*/
@@ -4595,7 +4992,7 @@ class _UnlinkedVariableReader extends fb.TableReader<_UnlinkedVariableImpl> {
_UnlinkedVariableImpl createObject(fb.BufferPointer bp) => new _UnlinkedVariableImpl(bp);
}
-class _UnlinkedVariableImpl implements UnlinkedVariable {
+class _UnlinkedVariableImpl extends Object with _UnlinkedVariableMixin implements UnlinkedVariable {
final fb.BufferPointer _bp;
_UnlinkedVariableImpl(this._bp);
@@ -4610,18 +5007,6 @@ class _UnlinkedVariableImpl implements UnlinkedVariable {
bool _hasImplicitType;
@override
- Map<String, Object> toMap() => {
- "name": name,
- "nameOffset": nameOffset,
- "documentationComment": documentationComment,
- "type": type,
- "isStatic": isStatic,
- "isFinal": isFinal,
- "isConst": isConst,
- "hasImplicitType": hasImplicitType,
- };
-
- @override
String get name {
_name ??= const fb.StringReader().vTableGet(_bp, 0, '');
return _name;
@@ -4670,3 +5055,17 @@ class _UnlinkedVariableImpl implements UnlinkedVariable {
}
}
+abstract class _UnlinkedVariableMixin implements UnlinkedVariable {
+ @override
+ Map<String, Object> toMap() => {
+ "name": name,
+ "nameOffset": nameOffset,
+ "documentationComment": documentationComment,
+ "type": type,
+ "isStatic": isStatic,
+ "isFinal": isFinal,
+ "isConst": isConst,
+ "hasImplicitType": hasImplicitType,
+ };
+}
+
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/name_filter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698