OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
612 * | 612 * |
613 * (r1, ..., rn, [p1 = d1, ..., pk = dk]) { | 613 * (r1, ..., rn, [p1 = d1, ..., pk = dk]) { |
614 * return this.invoke(name, [r1, ..., rn, p1, ..., pk]); | 614 * return this.invoke(name, [r1, ..., rn, p1, ..., pk]); |
615 * } | 615 * } |
616 * | 616 * |
617 * if m has required parameters r1, ..., rn, and optional positional | 617 * if m has required parameters r1, ..., rn, and optional positional |
618 * parameters p1, ..., pk with defaults d1, ..., dk. Otherwise, an | 618 * parameters p1, ..., pk with defaults d1, ..., dk. Otherwise, an |
619 * [ArgumentError] is thrown. | 619 * [ArgumentError] is thrown. |
620 */ | 620 */ |
621 Function operator [](Symbol name); | 621 Function operator [](Symbol name); |
622 | |
623 /** | |
624 * Returns a list of the imports and exports in this library; | |
625 */ | |
626 List<LibraryDependencyMirror> get libraryDependencies; | |
627 } | |
628 | |
rmacnak
2014/02/04 22:47:19
This is the same API as the source mirrors, with S
| |
629 /// A mirror on an import or export declaration. | |
630 abstract class LibraryDependencyMirror { | |
631 /// Is `true` if this dependency is an import. | |
632 bool get isImport; | |
633 | |
634 /// Is `true` if this dependency is an export. | |
635 bool get isExport; | |
636 | |
637 /// Returns the library mirror of the library that imports or exports the | |
638 /// [targetLibrary]. | |
639 LibraryMirror get sourceLibrary; | |
640 | |
641 /// Returns the library mirror of the library that is imported or exported. | |
642 LibraryMirror get targetLibrary; | |
643 | |
644 /// Returns the prefix if this is a prefixed import and `null` otherwise. | |
645 Symbol get prefix; | |
646 | |
647 /// Returns the list of show/hide combinators on the import/export | |
648 /// declaration. | |
649 List<CombinatorMirror> get combinators; | |
650 | |
651 /// Returns the source location for this import/export declaration. | |
652 SourceLocation get location; | |
653 | |
654 List<InstanceMirror> get metadata; | |
655 } | |
656 | |
657 /// A mirror on a show/hide combinator declared on a library dependency. | |
658 abstract class CombinatorMirror { | |
659 /// The list of identifiers on the combinator. | |
660 List<Symbol> get identifiers; | |
661 | |
662 /// Is `true` if this is a 'show' combinator. | |
663 bool get isShow; | |
664 | |
665 /// Is `true` if this is a 'hide' combinator. | |
666 bool get isHide; | |
622 } | 667 } |
623 | 668 |
624 /** | 669 /** |
625 * A [TypeMirror] reflects a Dart language class, typedef, | 670 * A [TypeMirror] reflects a Dart language class, typedef, |
626 * function type or type variable. | 671 * function type or type variable. |
627 */ | 672 */ |
628 abstract class TypeMirror implements DeclarationMirror { | 673 abstract class TypeMirror implements DeclarationMirror { |
629 /** | 674 /** |
630 * An immutable list with mirrors for all type variables for this type. | 675 * An immutable list with mirrors for all type variables for this type. |
631 * | 676 * |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1208 * | 1253 * |
1209 * When used as metadata on an import of "dart:mirrors", this metadata does | 1254 * When used as metadata on an import of "dart:mirrors", this metadata does |
1210 * not apply to the library in which the annotation is used, but instead | 1255 * not apply to the library in which the annotation is used, but instead |
1211 * applies to the other libraries (all libraries if "*" is used). | 1256 * applies to the other libraries (all libraries if "*" is used). |
1212 */ | 1257 */ |
1213 final override; | 1258 final override; |
1214 | 1259 |
1215 const MirrorsUsed( | 1260 const MirrorsUsed( |
1216 {this.symbols, this.targets, this.metaTargets, this.override}); | 1261 {this.symbols, this.targets, this.metaTargets, this.override}); |
1217 } | 1262 } |
OLD | NEW |