Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: pkg/docgen/lib/src/models/annotation.dart

Issue 242363004: pkg/docgen: moved model classes into minilibs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 library docgen.models.annotation;
2
3 import '../exports/mirrors_util.dart' as dart2js_util;
4 import '../exports/source_mirrors.dart';
5
6 import '../library_helpers.dart';
7
8 import 'library.dart';
9 import 'mirror_based.dart';
10
11 /// Holds the name of the annotation, and its parameters.
12 class Annotation extends MirrorBased {
13 /// The class of this annotation.
14 final ClassMirror mirror;
15 final Library owningLibrary;
16 List<String> parameters;
17
18 Annotation(InstanceMirror originalMirror, this.owningLibrary)
19 : mirror = originalMirror.type {
20 parameters = dart2js_util.variablesOf(originalMirror.type.declarations)
21 .where((e) => e.isFinal)
22 .map((e) => originalMirror.getField(e.simpleName).reflectee)
23 .where((e) => e != null)
24 .toList();
25 }
26
27 Map toMap() => {
28 'name': getDocgenObject(mirror, owningLibrary).docName,
29 'parameters': parameters
30 };
31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698