OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, the Dart Team. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in |
| 3 // the LICENSE file. |
| 4 |
| 5 /// File being transformed by the reflectable transformer. |
| 6 /// Creates a `MetaReflector` which may be used to reflect on the set of |
| 7 /// reflectors themselves. |
| 8 /// |
| 9 /// Independence: This is the only library in this program where both the |
| 10 /// reflector classes and the domain classes are seen together. The program |
| 11 /// as a whole illustrates a number of ways in which it is possible to make |
| 12 /// reflection, usage of reflection, and application specific classes (here |
| 13 /// known as 'domain classes') independent of each other, statically and |
| 14 /// dynamically. |
| 15 library test_reflectable.test.meta_reflectors_test; |
| 16 |
| 17 @GlobalQuantifyCapability(r"\.(M1|M2|M3|A|B|C|D)$", const Reflector()) |
| 18 @GlobalQuantifyCapability(r"\.(M1|M2|M3|B|C|D)$", const Reflector2()) |
| 19 @GlobalQuantifyCapability(r"\.(C|D)$", const ReflectorUpwardsClosed()) |
| 20 @GlobalQuantifyCapability(r"\.(C|D)$", const ReflectorUpwardsClosedToA()) |
| 21 @GlobalQuantifyCapability(r"\.(C|D)$", const ReflectorUpwardsClosedUntilA()) |
| 22 import "package:reflectable/reflectable.dart"; |
| 23 import "meta_reflectors_domain_definer.dart"; |
| 24 import "meta_reflectors_definer.dart"; |
| 25 import "meta_reflectors_meta.dart"; |
| 26 import "meta_reflectors_user.dart"; |
| 27 |
| 28 Map<String, Iterable<Reflectable>> scopeMap = <String, Iterable<Reflectable>>{ |
| 29 "polymer": <Reflectable>[const Reflector(), const ReflectorUpwardsClosed()], |
| 30 "observe": <Reflectable>[const Reflector2(), const ReflectorUpwardsClosed()] |
| 31 }; |
| 32 |
| 33 @ScopeMetaReflector() |
| 34 Iterable<Reflectable> reflectablesOfScope(String scope) => scopeMap[scope]; |
| 35 |
| 36 main() { |
| 37 runTests(); |
| 38 } |
OLD | NEW |