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

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

Issue 243483005: pkg/docgen: fixed type references within typedef doc comments (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: removed indent-json 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
« no previous file with comments | « no previous file | pkg/docgen/lib/src/models/dummy_mirror.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library docgen.models.annotation; 5 library docgen.models.annotation;
6 6
7 import '../exports/mirrors_util.dart' as dart2js_util; 7 import '../exports/mirrors_util.dart' as dart2js_util;
8 import '../exports/source_mirrors.dart'; 8 import '../exports/source_mirrors.dart';
9 9
10 import '../library_helpers.dart'; 10 import '../library_helpers.dart';
11 11
12 import 'library.dart'; 12 import 'library.dart';
13 import 'mirror_based.dart'; 13 import 'mirror_based.dart';
14 14
15 /// Holds the name of the annotation, and its parameters. 15 /// Holds the name of the annotation, and its parameters.
16 class Annotation extends MirrorBased { 16 class Annotation extends MirrorBased<ClassMirror> {
17 /// The class of this annotation. 17 /// The class of this annotation.
18 final ClassMirror mirror; 18 final ClassMirror mirror;
19 final Library owningLibrary; 19 final Library owningLibrary;
20 List<String> parameters; 20 final List<String> parameters;
21 21
22 Annotation(InstanceMirror originalMirror, this.owningLibrary) 22 Annotation(InstanceMirror originalMirror, this.owningLibrary)
23 : mirror = originalMirror.type { 23 : mirror = originalMirror.type,
24 parameters = dart2js_util.variablesOf(originalMirror.type.declarations) 24 parameters = _createParamaters(originalMirror);
25 .where((e) => e.isFinal)
26 .map((e) => originalMirror.getField(e.simpleName).reflectee)
27 .where((e) => e != null)
28 .toList();
29 }
30 25
31 Map toMap() => { 26 Map toMap() => {
32 'name': getDocgenObject(mirror, owningLibrary).docName, 27 'name': getDocgenObject(mirror, owningLibrary).docName,
33 'parameters': parameters 28 'parameters': parameters
34 }; 29 };
35 } 30 }
31
32 List<String> _createParamaters(InstanceMirror originalMirror) {
33 return dart2js_util.variablesOf(originalMirror.type.declarations)
34 .where((e) => e.isFinal)
35 .map((e) => originalMirror.getField(e.simpleName).reflectee)
36 .where((e) => e != null)
37 .toList();
38 }
OLDNEW
« no previous file with comments | « no previous file | pkg/docgen/lib/src/models/dummy_mirror.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698