| 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 /** | 5 /** |
| 6 * Defines the element model. The element model describes the semantic (as | 6 * Defines the element model. The element model describes the semantic (as |
| 7 * opposed to syntactic) structure of Dart code. The syntactic structure of the | 7 * opposed to syntactic) structure of Dart code. The syntactic structure of the |
| 8 * code is modeled by the [AST structure](../ast/ast.dart). | 8 * code is modeled by the [AST structure](../ast/ast.dart). |
| 9 * | 9 * |
| 10 * The element model consists of two closely related kinds of objects: elements | 10 * The element model consists of two closely related kinds of objects: elements |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 * | 750 * |
| 751 * <b>Note:</b> This method cannot be used in an async environment. | 751 * <b>Note:</b> This method cannot be used in an async environment. |
| 752 */ | 752 */ |
| 753 AstNode computeNode(); | 753 AstNode computeNode(); |
| 754 | 754 |
| 755 /** | 755 /** |
| 756 * Return the most immediate ancestor of this element for which the | 756 * Return the most immediate ancestor of this element for which the |
| 757 * [predicate] returns `true`, or `null` if there is no such ancestor. Note | 757 * [predicate] returns `true`, or `null` if there is no such ancestor. Note |
| 758 * that this element will never be returned. | 758 * that this element will never be returned. |
| 759 */ | 759 */ |
| 760 Element getAncestor(Predicate<Element> predicate); | 760 Element/*=E*/ getAncestor/*<E extends Element >*/( |
| 761 Predicate<Element> predicate); |
| 761 | 762 |
| 762 /** | 763 /** |
| 763 * Return a display name for the given element that includes the path to the | 764 * Return a display name for the given element that includes the path to the |
| 764 * compilation unit in which the type is defined. If [shortName] is `null` | 765 * compilation unit in which the type is defined. If [shortName] is `null` |
| 765 * then [getDisplayName] will be used as the name of this element. Otherwise | 766 * then [getDisplayName] will be used as the name of this element. Otherwise |
| 766 * the provided name will be used. | 767 * the provided name will be used. |
| 767 */ | 768 */ |
| 768 // TODO(brianwilkerson) Make the parameter optional. | 769 // TODO(brianwilkerson) Make the parameter optional. |
| 769 String getExtendedDisplayName(String shortName); | 770 String getExtendedDisplayName(String shortName); |
| 770 | 771 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 799 | 800 |
| 800 /** | 801 /** |
| 801 * Return a representation of the value of this annotation. | 802 * Return a representation of the value of this annotation. |
| 802 * | 803 * |
| 803 * Return `null` if the value of this annotation could not be computed because | 804 * Return `null` if the value of this annotation could not be computed because |
| 804 * of errors. | 805 * of errors. |
| 805 */ | 806 */ |
| 806 DartObject get constantValue; | 807 DartObject get constantValue; |
| 807 | 808 |
| 808 /** | 809 /** |
| 809 * Return a representation of the value of this annotation, forcing the value | |
| 810 * to be computed if it had not previously been computed, or `null` if the | |
| 811 * value of this annotation could not be computed because of errors. | |
| 812 */ | |
| 813 DartObject computeConstantValue(); | |
| 814 | |
| 815 /** | |
| 816 * Return the element representing the field, variable, or const constructor | 810 * Return the element representing the field, variable, or const constructor |
| 817 * being used as an annotation. | 811 * being used as an annotation. |
| 818 */ | 812 */ |
| 819 Element get element; | 813 Element get element; |
| 820 | 814 |
| 821 /** | 815 /** |
| 822 * Return `true` if this annotation marks the associated element as being | 816 * Return `true` if this annotation marks the associated element as being |
| 823 * deprecated. | 817 * deprecated. |
| 824 */ | 818 */ |
| 825 bool get isDeprecated; | 819 bool get isDeprecated; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 852 * Return `true` if this annotation marks the associated class as implementing | 846 * Return `true` if this annotation marks the associated class as implementing |
| 853 * a proxy object. | 847 * a proxy object. |
| 854 */ | 848 */ |
| 855 bool get isProxy; | 849 bool get isProxy; |
| 856 | 850 |
| 857 /** | 851 /** |
| 858 * Return `true` if this annotation marks the associated member as being | 852 * Return `true` if this annotation marks the associated member as being |
| 859 * required. | 853 * required. |
| 860 */ | 854 */ |
| 861 bool get isRequired; | 855 bool get isRequired; |
| 856 |
| 857 /** |
| 858 * Return a representation of the value of this annotation, forcing the value |
| 859 * to be computed if it had not previously been computed, or `null` if the |
| 860 * value of this annotation could not be computed because of errors. |
| 861 */ |
| 862 DartObject computeConstantValue(); |
| 862 } | 863 } |
| 863 | 864 |
| 864 /** | 865 /** |
| 865 * The enumeration `ElementKind` defines the various kinds of elements in the | 866 * The enumeration `ElementKind` defines the various kinds of elements in the |
| 866 * element model. | 867 * element model. |
| 867 * | 868 * |
| 868 * Clients may not extend, implement or mix-in this class. | 869 * Clients may not extend, implement or mix-in this class. |
| 869 */ | 870 */ |
| 870 class ElementKind extends Enum<ElementKind> { | 871 class ElementKind extends Enum<ElementKind> { |
| 871 static const ElementKind CLASS = const ElementKind('CLASS', 0, "class"); | 872 static const ElementKind CLASS = const ElementKind('CLASS', 0, "class"); |
| (...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1931 /** | 1932 /** |
| 1932 * Return a representation of the value of this variable. | 1933 * Return a representation of the value of this variable. |
| 1933 * | 1934 * |
| 1934 * Return `null` if either this variable was not declared with the 'const' | 1935 * Return `null` if either this variable was not declared with the 'const' |
| 1935 * modifier or if the value of this variable could not be computed because of | 1936 * modifier or if the value of this variable could not be computed because of |
| 1936 * errors. | 1937 * errors. |
| 1937 */ | 1938 */ |
| 1938 DartObject get constantValue; | 1939 DartObject get constantValue; |
| 1939 | 1940 |
| 1940 /** | 1941 /** |
| 1941 * Return a representation of the value of this variable, forcing the value | |
| 1942 * to be computed if it had not previously been computed, or `null` if either | |
| 1943 * this variable was not declared with the 'const' modifier or if the value of | |
| 1944 * this variable could not be computed because of errors. | |
| 1945 */ | |
| 1946 DartObject computeConstantValue(); | |
| 1947 | |
| 1948 /** | |
| 1949 * Return `true` if this variable element did not have an explicit type | 1942 * Return `true` if this variable element did not have an explicit type |
| 1950 * specified for it. | 1943 * specified for it. |
| 1951 */ | 1944 */ |
| 1952 bool get hasImplicitType; | 1945 bool get hasImplicitType; |
| 1953 | 1946 |
| 1954 /** | 1947 /** |
| 1955 * Return a synthetic function representing this variable's initializer, or | 1948 * Return a synthetic function representing this variable's initializer, or |
| 1956 * `null` if this variable does not have an initializer. The function will | 1949 * `null` if this variable does not have an initializer. The function will |
| 1957 * have no parameters. The return type of the function will be the | 1950 * have no parameters. The return type of the function will be the |
| 1958 * compile-time type of the initialization expression. | 1951 * compile-time type of the initialization expression. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2009 * > implicitly static. | 2002 * > implicitly static. |
| 2010 */ | 2003 */ |
| 2011 bool get isStatic; | 2004 bool get isStatic; |
| 2012 | 2005 |
| 2013 /** | 2006 /** |
| 2014 * Return the declared type of this variable, or `null` if the variable did | 2007 * Return the declared type of this variable, or `null` if the variable did |
| 2015 * not have a declared type (such as if it was declared using the keyword | 2008 * not have a declared type (such as if it was declared using the keyword |
| 2016 * 'var'). | 2009 * 'var'). |
| 2017 */ | 2010 */ |
| 2018 DartType get type; | 2011 DartType get type; |
| 2012 |
| 2013 /** |
| 2014 * Return a representation of the value of this variable, forcing the value |
| 2015 * to be computed if it had not previously been computed, or `null` if either |
| 2016 * this variable was not declared with the 'const' modifier or if the value of |
| 2017 * this variable could not be computed because of errors. |
| 2018 */ |
| 2019 DartObject computeConstantValue(); |
| 2019 } | 2020 } |
| OLD | NEW |