| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 /** | 126 /** |
| 127 * Is this declaration top-level? | 127 * Is this declaration top-level? |
| 128 * | 128 * |
| 129 * This is defined to be equivalent to: | 129 * This is defined to be equivalent to: |
| 130 * [:mirror.owner != null && mirror.owner is LibraryMirror:] | 130 * [:mirror.owner != null && mirror.owner is LibraryMirror:] |
| 131 */ | 131 */ |
| 132 bool get isTopLevel; | 132 bool get isTopLevel; |
| 133 } | 133 } |
| 134 | 134 |
| 135 /** | 135 /** |
| 136 * Common interface for interface types and libraries. | 136 * Common interface for classes and libraries. |
| 137 */ | 137 */ |
| 138 abstract class ObjectMirror implements Mirror { | 138 abstract class ContainerMirror implements Mirror { |
| 139 | 139 |
| 140 /** | 140 /** |
| 141 * Returns an unmodifiable map of the members of declared in this type or | 141 * An immutable map from from names to mirrors for all members in this |
| 142 * library. | 142 * container. |
| 143 */ | 143 */ |
| 144 Map<String, MemberMirror> get declaredMembers; | 144 Map<String, MemberMirror> get members; |
| 145 } | 145 } |
| 146 | 146 |
| 147 /** | 147 /** |
| 148 * A library. | 148 * A library. |
| 149 */ | 149 */ |
| 150 abstract class LibraryMirror implements ObjectMirror, DeclarationMirror { | 150 abstract class LibraryMirror implements ContainerMirror, DeclarationMirror { |
| 151 /** | 151 /** |
| 152 * An immutable map from from names to mirrors for all members in | 152 * An immutable map from from names to mirrors for all members in this |
| 153 * this library. | 153 * library. |
| 154 * | 154 * |
| 155 * The members of a library are its top-level classes, | 155 * The members of a library are its top-level classes, functions, variables, |
| 156 * functions, variables, getters, and setters. | 156 * getters, and setters. |
| 157 */ | 157 */ |
| 158 Map<String, Mirror> get members; | 158 Map<String, MemberMirror> get members; |
| 159 | 159 |
| 160 /** | 160 /** |
| 161 * An immutable map from names to mirrors for all class | 161 * An immutable map from names to mirrors for all class |
| 162 * declarations in this library. | 162 * declarations in this library. |
| 163 */ | 163 */ |
| 164 Map<String, ClassMirror> get classes; | 164 Map<String, ClassMirror> get classes; |
| 165 | 165 |
| 166 /** | 166 /** |
| 167 * An immutable map from names to mirrors for all function, getter, | 167 * An immutable map from names to mirrors for all function, getter, |
| 168 * and setter declarations in this library. | 168 * and setter declarations in this library. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 229 |
| 230 /** | 230 /** |
| 231 * Is [:true:] iff this type is a function type. | 231 * Is [:true:] iff this type is a function type. |
| 232 */ | 232 */ |
| 233 bool get isFunction; | 233 bool get isFunction; |
| 234 } | 234 } |
| 235 | 235 |
| 236 /** | 236 /** |
| 237 * A class or interface type. | 237 * A class or interface type. |
| 238 */ | 238 */ |
| 239 abstract class ClassMirror implements TypeMirror, ObjectMirror { | 239 abstract class ClassMirror implements TypeMirror, ContainerMirror { |
| 240 /** | 240 /** |
| 241 * A mirror on the original declaration of this type. | 241 * A mirror on the original declaration of this type. |
| 242 * | 242 * |
| 243 * For most classes, they are their own original declaration. For | 243 * For most classes, they are their own original declaration. For |
| 244 * generic classes, however, there is a distinction between the | 244 * generic classes, however, there is a distinction between the |
| 245 * original class declaration, which has unbound type variables, and | 245 * original class declaration, which has unbound type variables, and |
| 246 * the instantiations of generic classes, which have bound type | 246 * the instantiations of generic classes, which have bound type |
| 247 * variables. | 247 * variables. |
| 248 */ | 248 */ |
| 249 ClassMirror get originalDeclaration; | 249 ClassMirror get originalDeclaration; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 /** | 298 /** |
| 299 * An immutable map from from names to mirrors for all members of | 299 * An immutable map from from names to mirrors for all members of |
| 300 * this type. | 300 * this type. |
| 301 * | 301 * |
| 302 * The members of a type are its methods, fields, getters, and | 302 * The members of a type are its methods, fields, getters, and |
| 303 * setters. Note that constructors and type variables are not | 303 * setters. Note that constructors and type variables are not |
| 304 * considered to be members of a type. | 304 * considered to be members of a type. |
| 305 * | 305 * |
| 306 * This does not include inherited members. | 306 * This does not include inherited members. |
| 307 */ | 307 */ |
| 308 Map<String, Mirror> get members; | 308 Map<String, MemberMirror> get members; |
| 309 | 309 |
| 310 /** | 310 /** |
| 311 * An immutable map from names to mirrors for all method, | 311 * An immutable map from names to mirrors for all method, |
| 312 * declarations for this type. This does not include getters and | 312 * declarations for this type. This does not include getters and |
| 313 * setters. | 313 * setters. |
| 314 */ | 314 */ |
| 315 Map<String, MethodMirror> get methods; | 315 Map<String, MethodMirror> get methods; |
| 316 | 316 |
| 317 /** | 317 /** |
| 318 * An immutable map from names to mirrors for all getter | 318 * An immutable map from names to mirrors for all getter |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 /** | 569 /** |
| 570 * Returns the URI where the source originated. | 570 * Returns the URI where the source originated. |
| 571 */ | 571 */ |
| 572 Uri get uri; | 572 Uri get uri; |
| 573 | 573 |
| 574 /** | 574 /** |
| 575 * Returns the text of this source. | 575 * Returns the text of this source. |
| 576 */ | 576 */ |
| 577 String get text; | 577 String get text; |
| 578 } | 578 } |
| OLD | NEW |