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 library analyzer.dart.element.element; | 5 library analyzer.dart.element.element; |
6 | 6 |
7 import 'package:analyzer/dart/element/type.dart'; | 7 import 'package:analyzer/dart/element/type.dart'; |
8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
9 import 'package:analyzer/src/generated/constant.dart' show DartObject; | 9 import 'package:analyzer/src/generated/constant.dart' show DartObject; |
10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | 10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 * represent the semantic structure of the program. | 531 * represent the semantic structure of the program. |
532 * | 532 * |
533 * Clients may not extend, implement or mix-in this class. | 533 * Clients may not extend, implement or mix-in this class. |
534 */ | 534 */ |
535 abstract class Element implements AnalysisTarget { | 535 abstract class Element implements AnalysisTarget { |
536 /** | 536 /** |
537 * A comparator that can be used to sort elements by their name offset. | 537 * A comparator that can be used to sort elements by their name offset. |
538 * Elements with a smaller offset will be sorted to be before elements with a | 538 * Elements with a smaller offset will be sorted to be before elements with a |
539 * larger name offset. | 539 * larger name offset. |
540 */ | 540 */ |
541 static final Comparator<Element> SORT_BY_OFFSET = | 541 static final Comparator<Element> SORT_BY_OFFSET = (Element firstElement, |
542 (Element firstElement, Element secondElement) => | 542 Element secondElement) => |
543 firstElement.nameOffset - secondElement.nameOffset; | 543 firstElement.nameOffset - secondElement.nameOffset; |
544 | 544 |
545 /** | 545 /** |
546 * Return the analysis context in which this element is defined. | 546 * Return the analysis context in which this element is defined. |
547 */ | 547 */ |
548 AnalysisContext get context; | 548 AnalysisContext get context; |
549 | 549 |
550 /** | 550 /** |
551 * Return the display name of this element, or `null` if this element does not | 551 * Return the display name of this element, or `null` if this element does not |
552 * have a name. | 552 * have a name. |
553 * | 553 * |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 */ | 1300 */ |
1301 bool get hasExtUri; | 1301 bool get hasExtUri; |
1302 | 1302 |
1303 /** | 1303 /** |
1304 * Return `true` if this library defines a top-level function named | 1304 * Return `true` if this library defines a top-level function named |
1305 * `loadLibrary`. | 1305 * `loadLibrary`. |
1306 */ | 1306 */ |
1307 bool get hasLoadLibraryFunction; | 1307 bool get hasLoadLibraryFunction; |
1308 | 1308 |
1309 /** | 1309 /** |
| 1310 * Return an identifier that uniquely identifies this element among the |
| 1311 * children of this element's parent. |
| 1312 */ |
| 1313 String get identifier; |
| 1314 |
| 1315 /** |
1310 * Return a list containing all of the libraries that are imported into this | 1316 * Return a list containing all of the libraries that are imported into this |
1311 * library. This includes all of the libraries that are imported using a | 1317 * library. This includes all of the libraries that are imported using a |
1312 * prefix (also available through the prefixes returned by [getPrefixes]) and | 1318 * prefix (also available through the prefixes returned by [getPrefixes]) and |
1313 * those that are imported without a prefix. | 1319 * those that are imported without a prefix. |
1314 */ | 1320 */ |
1315 List<LibraryElement> get importedLibraries; | 1321 List<LibraryElement> get importedLibraries; |
1316 | 1322 |
1317 /** | 1323 /** |
1318 * Return a list containing all of the imports defined in this library. | 1324 * Return a list containing all of the imports defined in this library. |
1319 */ | 1325 */ |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 */ | 2029 */ |
2024 bool get isStatic; | 2030 bool get isStatic; |
2025 | 2031 |
2026 /** | 2032 /** |
2027 * Return the declared type of this variable, or `null` if the variable did | 2033 * Return the declared type of this variable, or `null` if the variable did |
2028 * not have a declared type (such as if it was declared using the keyword | 2034 * not have a declared type (such as if it was declared using the keyword |
2029 * 'var'). | 2035 * 'var'). |
2030 */ | 2036 */ |
2031 DartType get type; | 2037 DartType get type; |
2032 } | 2038 } |
OLD | NEW |