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