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

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: cl nits 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 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library docgen.models.annotation;
6
7 import '../exports/mirrors_util.dart' as dart2js_util;
8 import '../exports/source_mirrors.dart';
9
10 import '../library_helpers.dart';
11
12 import 'library.dart';
13 import 'mirror_based.dart';
14
15 /// Holds the name of the annotation, and its parameters.
16 class Annotation extends MirrorBased {
17 /// The class of this annotation.
18 final ClassMirror mirror;
19 final Library owningLibrary;
20 List<String> parameters;
21
22 Annotation(InstanceMirror originalMirror, this.owningLibrary)
23 : mirror = originalMirror.type {
24 parameters = dart2js_util.variablesOf(originalMirror.type.declarations)
25 .where((e) => e.isFinal)
26 .map((e) => originalMirror.getField(e.simpleName).reflectee)
27 .where((e) => e != null)
28 .toList();
29 }
30
31 Map toMap() => {
32 'name': getDocgenObject(mirror, owningLibrary).docName,
33 'parameters': parameters
34 };
35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698