| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /** | 5 /** |
| 6 * **docgen** is a tool for creating machine readable representations of Dart | 6 * **docgen** is a tool for creating machine readable representations of Dart |
| 7 * code metadata, including: classes, members, comments and annotations. | 7 * code metadata, including: classes, members, comments and annotations. |
| 8 * | 8 * |
| 9 * docgen is run on a `.dart` file or a directory containing `.dart` files. | 9 * docgen is run on a `.dart` file or a directory containing `.dart` files. |
| 10 * | 10 * |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 var clazz = entityMap[mirror.qualifiedName]; | 397 var clazz = entityMap[mirror.qualifiedName]; |
| 398 if (clazz == null) { | 398 if (clazz == null) { |
| 399 var superclass = mirror.superclass != null ? | 399 var superclass = mirror.superclass != null ? |
| 400 _class(mirror.superclass) : null; | 400 _class(mirror.superclass) : null; |
| 401 var interfaces = | 401 var interfaces = |
| 402 mirror.superinterfaces.map((interface) => _class(interface)); | 402 mirror.superinterfaces.map((interface) => _class(interface)); |
| 403 clazz = new Class(mirror.simpleName, superclass, _commentToHtml(mirror), | 403 clazz = new Class(mirror.simpleName, superclass, _commentToHtml(mirror), |
| 404 interfaces.toList(), _variables(mirror.variables), | 404 interfaces.toList(), _variables(mirror.variables), |
| 405 _methods(mirror.methods), _annotations(mirror), _generics(mirror), | 405 _methods(mirror.methods), _annotations(mirror), _generics(mirror), |
| 406 mirror.qualifiedName, _isHidden(mirror), mirror.owner.qualifiedName); | 406 mirror.qualifiedName, _isHidden(mirror), mirror.owner.qualifiedName); |
| 407 if (superclass != null) |
| 408 clazz.addInherited(superclass); |
| 409 interfaces.forEach((interface) { |
| 410 clazz.addInherited(interface); |
| 411 }); |
| 407 entityMap[mirror.qualifiedName] = clazz; | 412 entityMap[mirror.qualifiedName] = clazz; |
| 408 } | 413 } |
| 409 return clazz; | 414 return clazz; |
| 410 } | 415 } |
| 411 | 416 |
| 412 /** | 417 /** |
| 413 * Returns a map of [Class] objects constructed from [mirrorMap]. | 418 * Returns a map of [Class] objects constructed from [mirrorMap]. |
| 414 */ | 419 */ |
| 415 ClassGroup _classes(Map<String, ClassMirror> mirrorMap) { | 420 ClassGroup _classes(Map<String, ClassMirror> mirrorMap) { |
| 416 var group = new ClassGroup(); | 421 var group = new ClassGroup(); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 | 698 |
| 694 void addClass(ClassMirror mirror) { | 699 void addClass(ClassMirror mirror) { |
| 695 _currentClass = mirror; | 700 _currentClass = mirror; |
| 696 var clazz = _class(mirror); | 701 var clazz = _class(mirror); |
| 697 | 702 |
| 698 // Adding inherited parent variables and methods. | 703 // Adding inherited parent variables and methods. |
| 699 clazz.parent().forEach((parent) { | 704 clazz.parent().forEach((parent) { |
| 700 if (_isVisible(clazz)) { | 705 if (_isVisible(clazz)) { |
| 701 parent.addSubclass(clazz); | 706 parent.addSubclass(clazz); |
| 702 } | 707 } |
| 703 clazz.addInherited(parent); | |
| 704 }); | 708 }); |
| 705 | 709 |
| 706 clazz.ensureComments(); | 710 clazz.ensureComments(); |
| 707 | 711 |
| 708 if (isError(mirror.qualifiedName)) { | 712 if (isError(mirror.qualifiedName)) { |
| 709 errors[mirror.simpleName] = clazz; | 713 errors[mirror.simpleName] = clazz; |
| 710 } else if (mirror.isTypedef) { | 714 } else if (mirror.isTypedef) { |
| 711 if (_includePrivate || !mirror.isPrivate) { | 715 if (_includePrivate || !mirror.isPrivate) { |
| 712 entityMap[mirror.qualifiedName] = new Typedef(mirror.simpleName, | 716 entityMap[mirror.qualifiedName] = new Typedef(mirror.simpleName, |
| 713 mirror.value.returnType.qualifiedName, _commentToHtml(mirror), | 717 mirror.value.returnType.qualifiedName, _commentToHtml(mirror), |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 String qualifiedName; | 1023 String qualifiedName; |
| 1020 List<String> parameters; | 1024 List<String> parameters; |
| 1021 | 1025 |
| 1022 Annotation(this.qualifiedName, this.parameters); | 1026 Annotation(this.qualifiedName, this.parameters); |
| 1023 | 1027 |
| 1024 Map toMap() => { | 1028 Map toMap() => { |
| 1025 'name': qualifiedName, | 1029 'name': qualifiedName, |
| 1026 'parameters': parameters | 1030 'parameters': parameters |
| 1027 }; | 1031 }; |
| 1028 } | 1032 } |
| OLD | NEW |