mirrorme 0.2.2

  • readme.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 0

Mirror me

A mirrors helper library for the dart language.

Walkthrough

This is how you can scrap the metadata info from an object.

MetaDataHelper<MetaData, MethodMirror> mirrorHelper = new MetaDataHelper<MetaData, MethodMirror>();
List<MetaDataValue<MetaData>> mirrorModels = mirrorHelper.from(new Anno());

The annotated class.

class Anno {

  @MetaData("test")
  void test() {}
  
}

MetaDataValue has the following fields:

Symbol memberName;
InstanceMirror instanceMirror;
T object;

Search for classes that implement or extend for example the class Anno.

ClassSearcher<Anno> searcher = new ClassSearcher<Anno>();
List<Anno> searchResult = searcher.scan();

Notes to Contributors

Fork Mirrorme

If you'd like to contribute back to the core, you can fork this repository and send us a pull request, when it is ready.

If you are new to Git or GitHub, please read this guide first.

For usage see Dart Force

Realtime web framework for dart that uses forcemvc & mirrorme & wired source code

Changelog

This file contains highlights of what changes on each version of the forcemvc package.

Pub version 0.2.2

renaming to mirrorme

Pub version 0.2.1+1 - 0.2.1+5

add a method on MetadataValue to get the return type typeOfOwner

Pub version 0.2.1

extends the MetaDataHelper with method fromMirror, so we can look at it without instantiating it.

Pub version 0.2.0

add iml to gitignore Rename AnnotationChecker to AnnotationScanner Scan All libraries instead of just RootLibrary Add Documentation

Pub version 0.1.11

Change logic of annotation_checker and class_scanner to reduce size.

Pub version 0.1.10+3

Skip dart core libraries to scan for annotations.

Pub version 0.1.10 & 0.1.10+1 & 0.1.10+2

Add method 'getOtherMetadata' in the class 'MetaDataValue'.

Pub version 0.1.9

Extend MetaDataHelper so it can search for methods and variables.

Pub version 0.1.8

Adding name to get the string name out of the mirrors in the class 'MetaDataValue'.

Pub version 0.1.8

Adding functionality to check if a annotation is available on a class.

Pub version 0.1.7

Provide methodMirror in MetaDataValue and added a property to access parameters.

Pub version 0.1.6+2

Adding dev dependencies for unittests.

Pub version 0.1.6+1

Creating the correct instance of the correct class in class searcher.

Pub version 0.1.6

Adding a way to search for class that implements or extends a certain class with mirror operations.

Pub version 0.1.5

Solving a bug in metadata helpers to return a value.

Pub version 0.1.5

Adding a class scanner to get a list of all classes with a certain annotation.

Pub version 0.1.4 & 0.1.4+1

Adding invoke method to force metadata value.

Pub version 0.1.3 & 0.1.3+1

Adding some minor changes.

Pub version 0.1.2+1

Adding tests for mirrorhelpers and classes for annotation handling.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  mirrorme: ^0.2.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:mirrorme/mirrorme.dart';
  
Version Uploaded Documentation Archive
0.2.2 Jan 8, 2015 Go to the documentation of mirrorme 0.2.2 Download mirrorme 0.2.2 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Health suggestions

Fix lib/helpers/class_searcher.dart. (-0.50 points)

Analysis of lib/helpers/class_searcher.dart reported 1 hint:

line 11 col 11: The value of the local variable 'classCounter' isn't used.

Format lib/helpers/annotation_checker.dart.

Run dartfmt to format lib/helpers/annotation_checker.dart.

Format lib/helpers/class_scanner.dart.

Run dartfmt to format lib/helpers/class_scanner.dart.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/helpers/metadata_helpers.dart (Run dartfmt to format lib/helpers/metadata_helpers.dart.)
  • lib/helpers/metadata_value.dart (Run dartfmt to format lib/helpers/metadata_value.dart.)
  • lib/mirrorme.dart (Run dartfmt to format lib/mirrorme.dart.)

Maintenance issues and suggestions

Add SDK constraint in pubspec.yaml. (-50 points)

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

Package is too old. (-100 points)

The package was released more than two years ago.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use mirrorme.dart.

Dependencies

Package Constraint Resolved Available
Dev dependencies
unittest >=0.9.0 <0.9.1