annotation_crawler 0.1.0 copy "annotation_crawler: ^0.1.0" to clipboard
annotation_crawler: ^0.1.0 copied to clipboard

outdatedDart 1 only

Helps finding classes or methods with specific annotations.

Annotation Crawler #

Build Status

Helps finding annotated declarations in a particular scope.

Usage #

    
    import "annotation_crawler";

    main () {

      //perform all plays written by Arthur miller
      annotatedDeclarations(Author)
          .where((decl) => decl.declaration is ClassMirror && decl.annotation == const Author("Arthur Miller"))
          .map((decl) => decl.declaration.newInstance(const Symbol(""), ["Her majesty's Theater"]).reflectee)
          .forEach(perform);
      
      //Perform the first scence of ACT III of the Merchant of Venice
      var play = annotatedDeclarations(Title)
        .where((decl) => decl.annotation.name = "The Merchant of venice")
        .single.newInstance(const Symbol(""), ["Her majesty's theater"]);
      
      MethodMirror scene = annotatedDeclarations(Scene, on: play.runtimeType)
      .where((decl) => decl.annotation.act == "III" &&
                      decl.annotation.scene == "I")
      .single;
      
      perform(play.getField(scene.simpleName).reflectee); 

    }
0
likes
10
points
23
downloads

Publisher

unverified uploader

Weekly Downloads

Helps finding classes or methods with specific annotations.

License

MIT (license)

More

Packages that depend on annotation_crawler