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