A list of reflective targets.
Combined with metaTargets, this provides the complete list of reflective targets used by the library to which this metadata applies.
The following text is non-normative:
For now, there is no formal description of what a reflective target is. Informally, a target is a library, a class, a method or a field.
Dart2js currently supports the following formats to specify targets:
A (qualified) name is resolved to a target as follows:
.
and is a library name..
as a separator.For example:
library my.library.one; class A { var aField; } library main; @MirrorsUsed(targets: "my.library.one.A.aField") import "dart:mirrors";
The MirrorsUsed annotation specifies A
and aField
from library my.library.one
as targets. This will mark the class A
as a reflective target. The target specification for aField
has no effect, as there is no target in my.library.one
with that name.
Note that everything within a target also is available for reflection. So, if a library is specified as target, all classes in that library become targets for reflection. Likewise, if a class is a target, all its methods and fields become targets for reflection. As a consequence, aField
in the above example is also a reflective target.
final targets
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-mirrors/MirrorsUsed/targets.html