Create @GenerateReflector

This commit is contained in:
Tobe O 2018-08-21 10:48:08 -04:00
parent 99b1630caa
commit 5f79ec14e5
3 changed files with 40 additions and 2 deletions

View file

@ -1,3 +1,7 @@
# 1.0.0-alpha.8
* Fixed a bug where `_ReflectedTypeInstance.isAssignableTo` always failed.
* Added `@GenerateReflector` annotation.
# 1.0.0-alpha.7
* Add `EmptyReflector`.
* `ReflectedType.newInstance` now returns a `ReflectedInstance`.

View file

@ -1,4 +1,38 @@
export 'src/empty/empty.dart';
library angel_container;
export 'src/container.dart';
export 'src/empty/empty.dart';
export 'src/exception.dart';
export 'src/reflector.dart';
/// An annotation used by `package:angel_container_generator` to generate reflection metadata for types chosen by the user.
///
/// When attached to a library, it generates a class that implements the `Reflector` interface.
///
/// When attached to a class, it can be used to customize the output of the generator.
class GenerateReflector {
/// The list of types that should have reflection metadata generated for them.
final List<Type> types;
/// The list of top-level functions that should have reflection metadata generated for them.
final List<Function> functions;
/// The list of symbols within this class that should have reflection metadata generated for them.
///
/// If omitted, then all symbols will be included.
final List<Symbol> symbols;
/// An explicit name for the generated reflector.
///
/// By default, a class with the library's name in PascalCase is created,
/// with the text "Reflector" appended.
///
/// Ex. `my_cool_library` becomes `const MyCoolLibraryReflector()`.
final String name;
const GenerateReflector(
{this.types: const <Type>[],
this.functions: const <Function>[],
this.symbols: const <Symbol>[],
this.name});
}

View file

@ -1,5 +1,5 @@
name: angel_container
version: 1.0.0-alpha.7
version: 1.0.0-alpha.8
author: Tobe O <thosakwe@gmail.com>
description: "A better IoC container and dependency injector for Angel, ultimately allowing Angel to be used without dart:mirrors."
homepage: https://github.com/angel-dart/container.git