| OLD | NEW |
| 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library services.hierarchy; | 8 library services.hierarchy; |
| 9 | 9 |
| 10 import 'dart:async'; | 10 import 'dart:async'; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 parent.visitChildren(new _ElementVisitorAdapter((Element element) { | 22 parent.visitChildren(new _ElementVisitorAdapter((Element element) { |
| 23 if (name == null || element.displayName == name) { | 23 if (name == null || element.displayName == name) { |
| 24 children.add(element); | 24 children.add(element); |
| 25 } | 25 } |
| 26 })); | 26 })); |
| 27 return children; | 27 return children; |
| 28 } | 28 } |
| 29 | 29 |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * Returns non-synthetic members of the given [ClassElement] and its super |
| 33 * classes. |
| 34 * |
| 35 * Includes: fields, accessors and methods. |
| 36 * Excludes: constructors and synthetic elements. |
| 37 */ |
| 38 List<Element> getMembers(ClassElement clazz) { |
| 39 List<Element> members = <Element>[]; |
| 40 members.addAll(getClassMembers(clazz)); |
| 41 Set<ClassElement> superClasses = getSuperClasses(clazz); |
| 42 for (ClassElement superClass in superClasses) { |
| 43 members.addAll(getClassMembers(superClass)); |
| 44 } |
| 45 return members; |
| 46 } |
| 47 |
| 48 |
| 49 /** |
| 32 * Returns direct non-synthetic children of the given [ClassElement]. | 50 * Returns direct non-synthetic children of the given [ClassElement]. |
| 33 * | 51 * |
| 34 * Includes: fields, accessors and methods. | 52 * Includes: fields, accessors and methods. |
| 35 * Excludes: constructors and synthetic elements. | 53 * Excludes: constructors and synthetic elements. |
| 36 */ | 54 */ |
| 37 List<Element> getClassMembers(ClassElement clazz, [String name]) { | 55 List<Element> getClassMembers(ClassElement clazz, [String name]) { |
| 38 List<Element> members = <Element>[]; | 56 List<Element> members = <Element>[]; |
| 39 clazz.visitChildren(new _ElementVisitorAdapter((Element element) { | 57 clazz.visitChildren(new _ElementVisitorAdapter((Element element) { |
| 40 if (element.isSynthetic) { | 58 if (element.isSynthetic) { |
| 41 return; | 59 return; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 class _ElementVisitorAdapter extends GeneralizingElementVisitor { | 207 class _ElementVisitorAdapter extends GeneralizingElementVisitor { |
| 190 final ElementProcessor processor; | 208 final ElementProcessor processor; |
| 191 | 209 |
| 192 _ElementVisitorAdapter(this.processor); | 210 _ElementVisitorAdapter(this.processor); |
| 193 | 211 |
| 194 @override | 212 @override |
| 195 void visitElement(Element element) { | 213 void visitElement(Element element) { |
| 196 processor(element); | 214 processor(element); |
| 197 } | 215 } |
| 198 } | 216 } |
| OLD | NEW |