MethodMirror abstract class
A MethodMirror reflects a Dart language function, method, constructor, getter, or setter.
abstract class MethodMirror implements DeclarationMirror { /** * A mirror on the return type for the reflectee. */ TypeMirror get returnType; /** * A list of mirrors on the parameters for the reflectee. */ List<ParameterMirror> get parameters; /** * Is the reflectee static? * * For the purposes of the mirrors library, a top-level function is * considered static. */ bool get isStatic; /** * Is the reflectee abstract? */ bool get isAbstract; /** * Is the reflectee a regular function or method? * * A function or method is regular if it is not a getter, setter, or * constructor. Note that operators, by this definition, are * regular methods. */ bool get isRegularMethod; /** * Is the reflectee an operator? */ bool get isOperator; /** * Is the reflectee a getter? */ bool get isGetter; /** * Is the reflectee a setter? */ bool get isSetter; /** * Is the reflectee a constructor? */ bool get isConstructor; /** * The constructor name for named constructors and factory methods. * * For unnamed constructors, this is the empty string. For * non-constructors, this is the empty string. * * For example, [:'bar':] is the constructor name for constructor * [:Foo.bar:] of type [:Foo:]. */ String get constructorName; /** * Is the reflectee a const constructor? */ bool get isConstConstructor; /** * Is the reflectee a generative constructor? */ bool get isGenerativeConstructor; /** * Is the reflectee a redirecting constructor? */ bool get isRedirectingConstructor; /** * Is the reflectee a factory constructor? */ bool get isFactoryConstructor; }
Implements
Properties
final String constructorName #
The constructor name for named constructors and factory methods.
For unnamed constructors, this is the empty string. For non-constructors, this is the empty string.
For example, 'bar'
is the constructor name for constructor
Foo.bar
of type Foo
.
String get constructorName;
final bool isFactoryConstructor #
Is the reflectee a factory constructor?
bool get isFactoryConstructor;
final bool isGenerativeConstructor #
Is the reflectee a generative constructor?
bool get isGenerativeConstructor;
final bool isPrivate #
Is this declaration private?
Note that for libraries, this will be false
.
bool get isPrivate;
final bool isRedirectingConstructor #
Is the reflectee a redirecting constructor?
bool get isRedirectingConstructor;
final bool isRegularMethod #
Is the reflectee a regular function or method?
A function or method is regular if it is not a getter, setter, or constructor. Note that operators, by this definition, are regular methods.
bool get isRegularMethod;
final bool isStatic #
Is the reflectee static?
For the purposes of the mirrors library, a top-level function is considered static.
bool get isStatic;
final bool isTopLevel #
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 #
The source location of this Dart language entity.
SourceLocation get location;
final MirrorSystem mirrors #
The MirrorSystem that contains this mirror.
MirrorSystem get mirrors;
final DeclarationMirror owner #
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 List<ParameterMirror> parameters #
A list of mirrors on the parameters for the reflectee.
List<ParameterMirror> get parameters;
final String qualifiedName #
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 TypeMirror returnType #
A mirror on the return type for the reflectee.
TypeMirror get returnType;
final String simpleName #
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;