Dart API Referencedart:mirrorsTypedefMirror

TypedefMirror abstract class

A TypedefMirror represents a typedef in a Dart language program.

abstract class TypedefMirror implements ClassMirror {
  /**
   * The defining type for this typedef.
   *
   * For instance [:void f(int):] is the value for [:typedef void f(int):].
   */
  TypeMirror get value;
}

Implements

ClassMirror

Properties

final Map<String, MethodMirror> constructors #

inherited from ClassMirror

An immutable map from names to mirrors for all constructor declarations for this type.

Map<String, MethodMirror> get constructors;

final ClassMirror defaultFactory #

inherited from ClassMirror

A mirror on the default factory class or null if there is none.

TODO(turnidge): This functions goes away after the class/interface changes.

ClassMirror get defaultFactory;

final Map<String, MethodMirror> getters #

inherited from ClassMirror

An immutable map from names to mirrors for all getter declarations for this type.

Map<String, MethodMirror> get getters;

final bool isClass #

inherited from ClassMirror

Does this mirror represent a class?

TODO(turnidge): This functions goes away after the class/interface changes.

bool get isClass;

final bool isOriginalDeclaration #

inherited from ClassMirror

Is this the original declaration of this type?

For most classes, they are their own original declaration. For generic classes, however, there is a distinction between the original class declaration, which has unbound type variables, and the instantiations of generic classes, which have bound type variables.

bool get isOriginalDeclaration;

final bool isPrivate #

inherited from DeclarationMirror

Is this declaration private?

Note that for libraries, this will be false.

bool get isPrivate;

final bool isTopLevel #

inherited from DeclarationMirror

Is this declaration top-level?

This is defined to be equivalent to: mirror.owner !== null && mirror.owner is LibraryMirror

bool get isTopLevel;

final SourceLocation location #

inherited from DeclarationMirror

The source location of this Dart language entity.

SourceLocation get location;

final Map<String, Mirror> members #

inherited from ClassMirror

An immutable map from from names to mirrors for all members of this type.

The members of a type are its methods, fields, getters, and setters. Note that constructors and type variables are not considered to be members of a type.

This does not include inherited members.

Map<String, Mirror> get members;

final Map<String, MethodMirror> methods #

inherited from ClassMirror

An immutable map from names to mirrors for all method, declarations for this type. This does not include getters and setters.

Map<String, MethodMirror> get methods;

final MirrorSystem mirrors #

inherited from Mirror

The MirrorSystem that contains this mirror.

MirrorSystem get mirrors;

final ClassMirror originalDeclaration #

inherited from ClassMirror

A mirror on the original declaration of this type.

For most classes, they are their own original declaration. For generic classes, however, there is a distinction between the original class declaration, which has unbound type variables, and the instantiations of generic classes, which have bound type variables.

ClassMirror get originalDeclaration;

final DeclarationMirror owner #

inherited from DeclarationMirror

A mirror on the owner of this function. This is the declaration immediately surrounding the reflectee.

Note that for libraries, the owner will be null.

DeclarationMirror get owner;

final String qualifiedName #

inherited from DeclarationMirror

The fully-qualified name for this Dart language entity.

This name is qualified by the name of the owner. For instance, the qualified name of a method 'method' in class 'Class' in library 'library' is 'library.Class.method'.

TODO(turnidge): Specify whether this name is unique. Currently this is a gray area due to lack of clarity over whether library names are unique.

String get qualifiedName;

final Map<String, MethodMirror> setters #

inherited from ClassMirror

An immutable map from names to mirrors for all setter declarations for this type.

Map<String, MethodMirror> get setters;

final String simpleName #

inherited from DeclarationMirror

The simple name for this Dart language entity.

The simple name is in most cases the the identifier name of the entity, such as 'method' for a method void method() {...} or 'mylibrary' for a #library('mylibrary'); declaration.

String get simpleName;

final ClassMirror superclass #

inherited from ClassMirror

A mirror on the superclass on the reflectee.

If this type is Object or a typedef, the superClass will be null.

ClassMirror get superclass;

final List<ClassMirror> superinterfaces #

inherited from ClassMirror

A list of mirrors on the superinterfaces of the reflectee.

List<ClassMirror> get superinterfaces;

final Map<String, TypeMirror> typeArguments #

inherited from ClassMirror

An immutable map from names to mirrors for all type arguments for this type.

This map preserves the order of declaration of the type variables.

Map<String, TypeMirror> get typeArguments;

final Map<String, TypeVariableMirror> typeVariables #

inherited from ClassMirror

An immutable map from names to mirrors for all type variables for this type.

This map preserves the order of declaration of the type variables.

Map<String, TypeVariableMirror> get typeVariables;

final TypeMirror value #

The defining type for this typedef.

For instance void f(int) is the value for typedef void f(int).

TypeMirror get value;

final Map<String, VariableMirror> variables #

inherited from ClassMirror

An immutable map from names to mirrors for all variable declarations for this type.

Map<String, VariableMirror> get variables;

Methods

Future<InstanceMirror> getField(String fieldName) #

inherited from ObjectMirror

Invokes a getter and returns a mirror on the result. The getter can be the implicit getter for a field or a user-defined getter method.

TODO(turnidge): Handle ambiguous names.

Future<InstanceMirror> getField(String fieldName);

Future<InstanceMirror> invoke(String memberName, List<Object> positionalArguments, [Map<String, Object> namedArguments]) #

inherited from ObjectMirror

Invokes the named function and returns a mirror on the result.

TODO(turnidge): Properly document. TODO(turnidge): Handle ambiguous names. TODO(turnidge): Handle optional & named arguments.

Future<InstanceMirror> invoke(String memberName,
                              List<Object> positionalArguments,
                              [Map<String,Object> namedArguments]);

Future<InstanceMirror> newInstance(String constructorName, List<Object> positionalArguments, [Map<String, Object> namedArguments]) #

inherited from ClassMirror

Invokes the named constructor and returns a mirror on the result.

TODO(turnidge): Properly document.

Future<InstanceMirror> newInstance(String constructorName,
                                   List<Object> positionalArguments,
                                   [Map<String,Object> namedArguments]);

Future<InstanceMirror> setField(String fieldName, Object value) #

inherited from ObjectMirror

Invokes a setter and returns a mirror on the result. The setter may be either the implicit setter for a non-final field or a user-defined setter method.

TODO(turnidge): Handle ambiguous names.

Future<InstanceMirror> setField(String fieldName, Object value);