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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 */ | 119 */ |
120 abstract class LibraryMirror extends ObjectMirror { | 120 abstract class LibraryMirror extends ObjectMirror { |
121 /** | 121 /** |
122 * The name of the library, as given in #library(). | 122 * The name of the library, as given in #library(). |
123 */ | 123 */ |
124 String get simpleName; | 124 String get simpleName; |
125 | 125 |
126 /** | 126 /** |
127 * Returns an iterable over all types in the library. | 127 * Returns an iterable over all types in the library. |
128 */ | 128 */ |
129 Map<String, InterfaceMirror> get types; | 129 Map<String, ClassMirror> get types; |
130 | 130 |
131 /** | 131 /** |
132 * Returns the source location for this library. | 132 * Returns the source location for this library. |
133 */ | 133 */ |
134 Location get location; | 134 Location get location; |
135 | 135 |
136 /** | 136 /** |
137 * Returns the canonical URI for this library. | 137 * Returns the canonical URI for this library. |
138 */ | 138 */ |
139 Uri get uri; | 139 Uri get uri; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 /** | 181 /** |
182 * Is [:true:] iff this type is a function type. | 182 * Is [:true:] iff this type is a function type. |
183 */ | 183 */ |
184 bool get isFunction; | 184 bool get isFunction; |
185 } | 185 } |
186 | 186 |
187 /** | 187 /** |
188 * A class or interface type. | 188 * A class or interface type. |
189 */ | 189 */ |
190 abstract class InterfaceMirror implements TypeMirror, ObjectMirror { | 190 abstract class ClassMirror implements TypeMirror, ObjectMirror { |
191 /** | 191 /** |
192 * Returns the defining type, i.e. declaration of a type. | 192 * Returns the defining type, i.e. declaration of a type. |
193 */ | 193 */ |
194 InterfaceMirror get declaration; | 194 ClassMirror get declaration; |
195 | 195 |
196 /** | 196 /** |
197 * Returns the super class of this type, or null if this type is [Object] or a | 197 * Returns the super class of this type, or null if this type is [Object] or a |
198 * typedef. | 198 * typedef. |
199 */ | 199 */ |
200 InterfaceMirror get superclass; | 200 ClassMirror get superclass; |
201 | 201 |
202 /** | 202 /** |
203 * Returns a list of the interfaces directly implemented by this type. | 203 * Returns a list of the interfaces directly implemented by this type. |
204 */ | 204 */ |
205 List<InterfaceMirror> get interfaces; | 205 List<ClassMirror> get interfaces; |
206 | 206 |
207 /** | 207 /** |
208 * Is [:true:] iff this type is a class. | 208 * Is [:true:] iff this type is a class. |
209 */ | 209 */ |
210 bool get isClass; | 210 bool get isClass; |
211 | 211 |
212 /** | 212 /** |
213 * Is [:true:] iff this type is an interface. | 213 * Is [:true:] iff this type is an interface. |
214 */ | 214 */ |
215 bool get isInterface; | 215 bool get isInterface; |
(...skipping 24 matching lines...) Expand all Loading... |
240 List<TypeVariableMirror> get typeVariables; | 240 List<TypeVariableMirror> get typeVariables; |
241 | 241 |
242 /** | 242 /** |
243 * Returns an immutable map of the constructors in this interface. | 243 * Returns an immutable map of the constructors in this interface. |
244 */ | 244 */ |
245 Map<String, MethodMirror> get constructors; | 245 Map<String, MethodMirror> get constructors; |
246 | 246 |
247 /** | 247 /** |
248 * Returns the default type for this interface. | 248 * Returns the default type for this interface. |
249 */ | 249 */ |
250 InterfaceMirror get defaultType; | 250 ClassMirror get defaultType; |
251 } | 251 } |
252 | 252 |
253 /** | 253 /** |
254 * A type parameter as declared on a generic type. | 254 * A type parameter as declared on a generic type. |
255 */ | 255 */ |
256 abstract class TypeVariableMirror implements TypeMirror { | 256 abstract class TypeVariableMirror implements TypeMirror { |
257 /** | 257 /** |
258 * Return a mirror on the class, interface, or typedef that declared the | 258 * Return a mirror on the class, interface, or typedef that declared the |
259 * type variable. | 259 * type variable. |
260 */ | 260 */ |
261 // Should not be called [declaration] as we then would have two [TypeMirror] | 261 // Should not be called [declaration] as we then would have two [TypeMirror] |
262 // subtypes ([InterfaceMirror] and [TypeVariableMirror]) which have | 262 // subtypes ([InterfaceMirror] and [TypeVariableMirror]) which have |
263 // [declaration()] methods but with different semantics. | 263 // [declaration()] methods but with different semantics. |
264 InterfaceMirror get declarer; | 264 ClassMirror get declarer; |
265 | 265 |
266 /** | 266 /** |
267 * Returns the bound of the type parameter. | 267 * Returns the bound of the type parameter. |
268 */ | 268 */ |
269 TypeMirror get bound; | 269 TypeMirror get bound; |
270 } | 270 } |
271 | 271 |
272 /** | 272 /** |
273 * A function type. | 273 * A function type. |
274 */ | 274 */ |
275 abstract class FunctionTypeMirror implements InterfaceMirror { | 275 abstract class FunctionTypeMirror implements ClassMirror { |
276 /** | 276 /** |
277 * Returns the return type of this function type. | 277 * Returns the return type of this function type. |
278 */ | 278 */ |
279 TypeMirror get returnType; | 279 TypeMirror get returnType; |
280 | 280 |
281 /** | 281 /** |
282 * Returns the parameters for this function type. | 282 * Returns the parameters for this function type. |
283 */ | 283 */ |
284 List<ParameterMirror> get parameters; | 284 List<ParameterMirror> get parameters; |
285 | 285 |
286 /** | 286 /** |
287 * Returns the call method for this function type. | 287 * Returns the call method for this function type. |
288 */ | 288 */ |
289 MethodMirror get callMethod; | 289 MethodMirror get callMethod; |
290 } | 290 } |
291 | 291 |
292 /** | 292 /** |
293 * A typedef. | 293 * A typedef. |
294 */ | 294 */ |
295 abstract class TypedefMirror implements InterfaceMirror { | 295 abstract class TypedefMirror implements ClassMirror { |
296 /** | 296 /** |
297 * Returns the defining type for this typedef. For instance [:void f(int):] | 297 * Returns the defining type for this typedef. For instance [:void f(int):] |
298 * for a [:typedef void f(int):]. | 298 * for a [:typedef void f(int):]. |
299 */ | 299 */ |
300 TypeMirror get definition; | 300 TypeMirror get definition; |
301 } | 301 } |
302 | 302 |
303 /** | 303 /** |
304 * A member of a type, i.e. a field, method or constructor. | 304 * A member of a type, i.e. a field, method or constructor. |
305 */ | 305 */ |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 /** | 500 /** |
501 * Returns the URI where the source originated. | 501 * Returns the URI where the source originated. |
502 */ | 502 */ |
503 Uri get uri; | 503 Uri get uri; |
504 | 504 |
505 /** | 505 /** |
506 * Returns the text of this source. | 506 * Returns the text of this source. |
507 */ | 507 */ |
508 String get text; | 508 String get text; |
509 } | 509 } |
OLD | NEW |