OLD | NEW |
---|---|
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library docgen.models.indexable; | 5 library docgen.models.indexable; |
6 | 6 |
7 import 'package:markdown/markdown.dart' as markdown; | 7 import 'package:markdown/markdown.dart' as markdown; |
8 | 8 |
9 import '../exports/mirrors_util.dart' as dart2js_util; | 9 import '../exports/mirrors_util.dart' as dart2js_util; |
10 import '../exports/source_mirrors.dart'; | 10 import '../exports/source_mirrors.dart'; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 /// | 116 /// |
117 /// "Owning" is defined as the object one scope-level above which this item | 117 /// "Owning" is defined as the object one scope-level above which this item |
118 /// is defined. Ex: The owner for a top level class, would be its enclosing | 118 /// is defined. Ex: The owner for a top level class, would be its enclosing |
119 /// library. The owner of a local variable in a method would be the enclosing | 119 /// library. The owner of a local variable in a method would be the enclosing |
120 /// method. | 120 /// method. |
121 Indexable get owner => new DummyMirror(mirror.owner); | 121 Indexable get owner => new DummyMirror(mirror.owner); |
122 | 122 |
123 /// Generates MDN comments from database.json. | 123 /// Generates MDN comments from database.json. |
124 String getMdnComment(); | 124 String getMdnComment(); |
125 | 125 |
126 /// The type of this member to be used in index.txt. | 126 String get typeName; |
kevmoo
2014/04/20 21:34:54
Every type implements this, so making it abstract.
| |
127 String get typeName => ''; | |
128 | 127 |
129 /// Creates a [Map] with this [Indexable]'s name and a preview comment. | 128 /// Creates a [Map] with this [Indexable]'s name and a preview comment. |
130 Map get previewMap { | 129 Map get previewMap { |
131 var finalMap = { 'name' : name, 'qualifiedName' : qualifiedName }; | 130 var finalMap = { 'name' : name, 'qualifiedName' : qualifiedName }; |
132 var pre = preview; | 131 var pre = preview; |
133 if (pre != null) finalMap['preview'] = pre; | 132 if (pre != null) finalMap['preview'] = pre; |
134 return finalMap; | 133 return finalMap; |
135 } | 134 } |
136 | 135 |
137 String get preview { | 136 String get preview { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 /// Return a map representation of this type. | 183 /// Return a map representation of this type. |
185 Map toMap(); | 184 Map toMap(); |
186 | 185 |
187 /// Accessor to determine if this item and all of its owners are visible. | 186 /// Accessor to determine if this item and all of its owners are visible. |
188 bool get isVisible => isFullChainVisible(this); | 187 bool get isVisible => isFullChainVisible(this); |
189 | 188 |
190 /// Returns true if [mirror] is the correct type of mirror that this Docgen | 189 /// Returns true if [mirror] is the correct type of mirror that this Docgen |
191 /// object wraps. (Workaround for the fact that Types are not first class.) | 190 /// object wraps. (Workaround for the fact that Types are not first class.) |
192 bool isValidMirror(DeclarationMirror mirror); | 191 bool isValidMirror(DeclarationMirror mirror); |
193 } | 192 } |
OLD | NEW |