OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 mirrors; | 5 library mirrors; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'dart:uri'; | 9 import 'dart:uri'; |
10 | 10 |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 */ | 226 */ |
227 abstract class TypeInstanceMirror implements InstanceMirror { | 227 abstract class TypeInstanceMirror implements InstanceMirror { |
228 /** | 228 /** |
229 * Returns the type mirror for the type represented by the reflected type | 229 * Returns the type mirror for the type represented by the reflected type |
230 * constant. | 230 * constant. |
231 */ | 231 */ |
232 TypeMirror get representedType; | 232 TypeMirror get representedType; |
233 } | 233 } |
234 | 234 |
235 /** | 235 /** |
| 236 * Specialized [InstanceMirror] used for reflection on comments as metadata. |
| 237 */ |
| 238 abstract class CommentInstanceMirror implements InstanceMirror { |
| 239 /** |
| 240 * The comment text as written in the source text. |
| 241 */ |
| 242 String get text; |
| 243 |
| 244 /** |
| 245 * The comment text without the start, end, and padding text. |
| 246 * |
| 247 * For example, if [text] is [: /** Comment text. */ :] then the [trimmedText] |
| 248 * is [: Comment text. :]. |
| 249 */ |
| 250 String get trimmedText; |
| 251 |
| 252 /** |
| 253 * Is [:true:] if this comment is a documentation comment. |
| 254 * |
| 255 * That is, that the comment is either enclosed in [: /** ... */ :] or starts |
| 256 * with [: /// :]. |
| 257 */ |
| 258 bool get isDocComment; |
| 259 } |
| 260 |
| 261 /** |
236 * Common interface for classes and libraries. | 262 * Common interface for classes and libraries. |
237 */ | 263 */ |
238 abstract class ContainerMirror implements Mirror { | 264 abstract class ContainerMirror implements Mirror { |
239 | 265 |
240 /** | 266 /** |
241 * An immutable map from from names to mirrors for all members in this | 267 * An immutable map from from names to mirrors for all members in this |
242 * container. | 268 * container. |
243 */ | 269 */ |
244 Map<String, MemberMirror> get members; | 270 Map<String, MemberMirror> get members; |
245 } | 271 } |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 /** | 729 /** |
704 * Returns the URI where the source originated. | 730 * Returns the URI where the source originated. |
705 */ | 731 */ |
706 Uri get sourceUri; | 732 Uri get sourceUri; |
707 | 733 |
708 /** | 734 /** |
709 * Returns the text of this source. | 735 * Returns the text of this source. |
710 */ | 736 */ |
711 String get sourceText; | 737 String get sourceText; |
712 } | 738 } |
713 | |
714 /** | |
715 * Class used for encoding dartdoc comments as metadata annotations. | |
716 */ | |
717 class DartdocComment { | |
718 final String text; | |
719 | |
720 const DartdocComment(this.text); | |
721 } | |
OLD | NEW |