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 // For the purposes of the mirrors library, we adopt a naming | 5 // For the purposes of the mirrors library, we adopt a naming |
6 // convention with respect to getters and setters. Specifically, for | 6 // convention with respect to getters and setters. Specifically, for |
7 // some variable or field... | 7 // some variable or field... |
8 // | 8 // |
9 // var myField; | 9 // var myField; |
10 // | 10 // |
11 // ...the getter is named 'myField' and the setter is named | 11 // ...the getter is named 'myField' and the setter is named |
12 // 'myField='. This allows us to assign unique names to getters and | 12 // 'myField='. This allows us to assign unique names to getters and |
13 // setters for the purposes of member lookup. | 13 // setters for the purposes of member lookup. |
14 | 14 |
15 library dart.mirrors; | 15 library dart.mirrors; |
16 | 16 |
17 import 'dart:async'; | 17 import 'dart:async'; |
18 import 'dart:isolate'; | 18 import 'dart:isolate'; |
| 19 import 'dart:uri'; |
19 | 20 |
20 /** | 21 /** |
21 * A [MirrorSystem] is the main interface used to reflect on a set of | 22 * A [MirrorSystem] is the main interface used to reflect on a set of |
22 * associated libraries. | 23 * associated libraries. |
23 * | 24 * |
24 * At runtime each running isolate has a distinct [MirrorSystem]. | 25 * At runtime each running isolate has a distinct [MirrorSystem]. |
25 * | 26 * |
26 * It is also possible to have a [MirrorSystem] which represents a set | 27 * It is also possible to have a [MirrorSystem] which represents a set |
27 * of libraries which are not running -- perhaps at compile-time. In | 28 * of libraries which are not running -- perhaps at compile-time. In |
28 * this case, all available reflective functionality would be | 29 * this case, all available reflective functionality would be |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 Future<InstanceMirror> findInContext(Symbol name); | 330 Future<InstanceMirror> findInContext(Symbol name); |
330 } | 331 } |
331 | 332 |
332 /** | 333 /** |
333 * A [LibraryMirror] reflects a Dart language library, providing | 334 * A [LibraryMirror] reflects a Dart language library, providing |
334 * access to the variables, functions, and classes of the | 335 * access to the variables, functions, and classes of the |
335 * library. | 336 * library. |
336 */ | 337 */ |
337 abstract class LibraryMirror implements DeclarationMirror, ObjectMirror { | 338 abstract class LibraryMirror implements DeclarationMirror, ObjectMirror { |
338 /** | 339 /** |
339 * The url of the library. | 340 * The absolute uri of the library. |
340 * | |
341 * TODO(turnidge): Document where this url comes from. Will this | |
342 * value be sensible? | |
343 */ | 341 */ |
344 // TODO(ahe): Change type to [Uri], rename to "uri"? | 342 Uri get uri; |
345 String get url; | |
346 | 343 |
347 /** | 344 /** |
348 * An immutable map from from names to mirrors for all members in | 345 * An immutable map from from names to mirrors for all members in |
349 * this library. | 346 * this library. |
350 * | 347 * |
351 * The members of a library are its top-level classes, | 348 * The members of a library are its top-level classes, |
352 * functions, variables, getters, and setters. | 349 * functions, variables, getters, and setters. |
353 */ | 350 */ |
354 Map<Symbol, Mirror> get members; | 351 Map<Symbol, Mirror> get members; |
355 | 352 |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 /** | 819 /** |
823 * Is [:true:] if this comment is a documentation comment. | 820 * Is [:true:] if this comment is a documentation comment. |
824 * | 821 * |
825 * That is, that the comment is either enclosed in [: /** ... */ :] or starts | 822 * That is, that the comment is either enclosed in [: /** ... */ :] or starts |
826 * with [: /// :]. | 823 * with [: /// :]. |
827 */ | 824 */ |
828 final bool isDocComment; | 825 final bool isDocComment; |
829 | 826 |
830 const Comment(this.text, this.trimmedText, this.isDocComment); | 827 const Comment(this.text, this.trimmedText, this.isDocComment); |
831 } | 828 } |
OLD | NEW |