ReflectorData class
The data backing a reflector.
Constructors
-
ReflectorData(List<
TypeMirror> typeMirrors, List<DeclarationMirror> ? memberMirrors, List<ParameterMirror> ? parameterMirrors, List<Type> types, int supportedClassCount, Map<String, InvokerOfGetter> getters, Map<String, InvokerOfSetter> setters, List<LibraryMirror> ? libraryMirrors, List<List> ? parameterListShapes)
Properties
-
getters
→ Map<
String, InvokerOfGetter> -
Map from getter names to closures accepting an instance and returning
the result of invoking the getter with that name on that instance.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
libraryMirrors
→ List<
LibraryMirror> ? -
List of library mirrors, one library mirror for each library that is
supported by reflection as specified by the reflector backed up
by this ReflectorData.
final
-
memberMirrors
→ List<
DeclarationMirror> ? -
Repository of method mirrors used (via indices into this list) by the
class mirrors in typeMirrors to describe the behavior of the mirrored
class and its instances, and of variable mirrors used to describe
their state. From the behavioral point of view there are no fields,
but each of them gives rise to a getter and possibly a setter (whose
isSyntheticis true). The implicit getters/setters are not stored in this list, but they can be reconstructed based on the variable mirrors describing the fields. From the program structure point of view (used fordeclarations), the method mirrors and the field mirrors must both be included directly. Hence, both points of view require a little bit of processing, but in return we avoid some redundancy in the stored information.final -
parameterListShapes
→ List<
List> ? -
List of parameter list shapes. Each entry is a list containing data on
one shape of parameter list. The same shape is shared, e.g., by methods
like
void foo(int a, [String b])andList bar(x, [y])because the shape is independent of type annotations and names, and only describes the number and kind of parameters. It is represented as a list containing three elements: Anintspecifying the number of positional parameters, anintdescribing the number of optional positional parameters, and aListcontainingSymbolvalues for the names of named parameters.final -
parameterMirrors
→ List<
ParameterMirror> ? -
Repository of parameter mirrors used (via indices into this list) by
the memberMirrors to describe the parameters of methods
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
setters
→ Map<
String, InvokerOfSetter> -
Map from setter names to closures accepting an instance and a new value,
invoking the setter of that name on that instance, and returning its
return value.
final
- supportedClassCount → int
-
Number of entries in types describing supported classes
final
-
typeMirrors
→ List<
TypeMirror> -
List of type mirrors, one ClassMirror for each class that is
supported by reflection as specified by the reflector backed up
by this ReflectorData, and one TypeVariableMirror for each
type variable declared by those classes.
final
-
types
→ List<
Type> -
List of Types divided into two parts. At the low indices until
supportedClassCount, it is a list of Types used to select class
mirrors: If M is a class mirror in typeMirrors at index
i, the mirrored class (and hence the runtime type of the mirrored instances) is found intypes[i]. At indices greater than or equal to supportedClassCount, it is a list of Types used to provide a value fordynamicReflectedTypeanddynamicReflectedReturnType.final
Methods
-
classMirrorForInstance(
Object? instance) → ClassMirror? -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
typeMirrorForType(
Type type) → TypeMirror? -
Returns a type mirror for the given
type.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited