GetFieldsAnnotatedWith<T> class

Get List of variables annotated with T from the InstanceMirror instance. For example:

class ObjectWithAnnotatedAttr {

  @Annotation1()
  @Annotation2()
  var annotated1

  @Annotation1()
  var annotated2
}

main() {
  var o = new ObjectWithAnnotatedAttr();

  // should return a list of [VariableMirror] of annotated1 and annotated2
  var variablesAnnotatedWithAnnotation1 = new GetFieldsAnnotatedWith<Annotation1>().from(o);

  // should return a list of [VariableMirror] of annotated1
  var fieldsAnnotatedWithAnnotation2 = new GetFieldsAnnotatedWith<Annotation2>().from(o);
}

Constructors

GetFieldsAnnotatedWith()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

from(dynamic instance) Iterable<DeclarationMirror>?
Get List of variables annotated with T from the InstanceMirror instance. For example:
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited