@@ -60,6 +60,186 @@ import 'package:analyzer/src/task/api/model.dart' show AnalysisTarget;
6060import 'package:meta/meta.dart' ;
6161import 'package:pub_semver/pub_semver.dart' ;
6262
63+ /// The result of applying augmentations to a [ClassElement] .
64+ ///
65+ /// Clients may not extend, implement or mix-in this class.
66+ @Deprecated (elementModelDeprecationMsg)
67+ abstract class AugmentedClassElement implements AugmentedInterfaceElement {
68+ @override
69+ ClassElement get firstFragment;
70+ }
71+
72+ /// The result of applying augmentations to an [EnumElement] .
73+ ///
74+ /// Clients may not extend, implement or mix-in this class.
75+ @Deprecated (elementModelDeprecationMsg)
76+ abstract class AugmentedEnumElement implements AugmentedInterfaceElement {
77+ /// The enum constants declared in this element.
78+ List <FieldElement > get constants;
79+
80+ @override
81+ EnumElement get firstFragment;
82+ }
83+
84+ /// The result of applying augmentations to an [ExtensionElement] .
85+ ///
86+ /// Clients may not extend, implement or mix-in this class.
87+ @Deprecated (elementModelDeprecationMsg)
88+ abstract class AugmentedExtensionElement implements AugmentedInstanceElement {
89+ /// The type that is extended by this extension.
90+ DartType get extendedType;
91+ }
92+
93+ /// The result of applying augmentations to an [ExtensionTypeElement] .
94+ ///
95+ /// Clients may not extend, implement or mix-in this class.
96+ @Deprecated (elementModelDeprecationMsg)
97+ abstract class AugmentedExtensionTypeElement
98+ implements AugmentedInterfaceElement {
99+ @override
100+ ExtensionTypeElement get firstFragment;
101+
102+ /// The primary constructor of this extension.
103+ ConstructorElement get primaryConstructor;
104+
105+ /// The representation of this extension.
106+ FieldElement get representation;
107+
108+ /// The extension type erasure, obtained by recursively replacing every
109+ /// subterm which is an extension type by the corresponding representation
110+ /// type.
111+ DartType get typeErasure;
112+ }
113+
114+ /// The result of applying augmentations to a [InstanceElement] .
115+ ///
116+ /// Clients may not extend, implement or mix-in this class.
117+ @Deprecated (elementModelDeprecationMsg)
118+ abstract class AugmentedInstanceElement {
119+ /// The accessors (getters and setters) declared in this element.
120+ ///
121+ /// [PropertyAccessorElement] s replace corresponding elements,
122+ /// other [PropertyAccessorElement] s are appended.
123+ List <PropertyAccessorElement > get accessors;
124+
125+ /// The fields declared in this element.
126+ ///
127+ /// `FieldAugmentationElement` s replace corresponding elements, other
128+ /// [FieldElement] s are appended.
129+ List <FieldElement > get fields;
130+
131+ /// The declaration (not augmentation) that owns this result.
132+ InstanceElement get firstFragment;
133+
134+ /// The metadata associated with this element.
135+ ///
136+ /// This is a union of annotations associated with the class declaration and
137+ /// all its augmentations.
138+ List <ElementAnnotation > get metadata;
139+
140+ /// The methods declared in this element.
141+ ///
142+ /// `MethodAugmentationElement` s replace corresponding elements, other
143+ /// [MethodElement] s are appended.
144+ List <MethodElement > get methods;
145+
146+ /// The type of `this` expression.
147+ DartType get thisType;
148+
149+ /// Returns the field from [fields] that has the given [name] .
150+ FieldElement ? getField (String name);
151+
152+ /// Returns the getter from [accessors] that has the given [name] .
153+ PropertyAccessorElement ? getGetter (String name);
154+
155+ /// Returns the method from [methods] that has the given [name] .
156+ MethodElement ? getMethod (String name);
157+
158+ /// Returns the setter from [accessors] that has the given [name] .
159+ PropertyAccessorElement ? getSetter (String name);
160+
161+ /// Returns the element representing the getter that results from looking up
162+ /// the given [name] in this class with respect to the given [library] ,
163+ /// or `null` if the look up fails.
164+ ///
165+ /// The behavior of this method is defined by the Dart Language Specification
166+ /// in section 17.18 Lookup.
167+ PropertyAccessorElement ? lookUpGetter ({
168+ required String name,
169+ required LibraryElement library,
170+ });
171+
172+ /// Returns the element representing the method that results from looking up
173+ /// the given [name] in this class with respect to the given [library] ,
174+ /// or `null` if the look up fails.
175+ ///
176+ /// The behavior of this method is defined by the Dart Language Specification
177+ /// in section 17.18 Lookup.
178+ MethodElement ? lookUpMethod ({
179+ required String name,
180+ required LibraryElement library,
181+ });
182+
183+ /// Returns the element representing the setter that results from looking up
184+ /// the given [name] in this class with respect to the given [library] ,
185+ /// or `null` if the look up fails.
186+ ///
187+ /// The behavior of this method is defined by the Dart Language Specification
188+ /// in section 17.18 Lookup.
189+ PropertyAccessorElement ? lookUpSetter ({
190+ required String name,
191+ required LibraryElement library,
192+ });
193+ }
194+
195+ /// The result of applying augmentations to a [InterfaceElement] .
196+ ///
197+ /// Clients may not extend, implement or mix-in this class.
198+ @Deprecated (elementModelDeprecationMsg)
199+ abstract class AugmentedInterfaceElement implements AugmentedInstanceElement {
200+ /// The constructors declared in this element.
201+ ///
202+ /// `ConstructorAugmentationElement` s replace corresponding elements,
203+ /// other [ConstructorElement] s are appended.
204+ List <ConstructorElement > get constructors;
205+
206+ @override
207+ InterfaceElement get firstFragment;
208+
209+ /// The interfaces implemented by this element.
210+ ///
211+ /// This is a union of interfaces declared by the class declaration and
212+ /// all its augmentations.
213+ List <InterfaceType > get interfaces;
214+
215+ /// The mixins applied by this class or in its augmentations.
216+ ///
217+ /// This is a union of mixins applied by the class declaration and all its
218+ /// augmentations.
219+ List <InterfaceType > get mixins;
220+
221+ @override
222+ InterfaceType get thisType;
223+
224+ /// The unnamed constructor from [constructors] .
225+ ConstructorElement ? get unnamedConstructor;
226+
227+ /// Returns the constructor from [constructors] that has the given [name] .
228+ ConstructorElement ? getNamedConstructor (String name);
229+ }
230+
231+ /// The result of applying augmentations to a [MixinElement] .
232+ ///
233+ /// Clients may not extend, implement or mix-in this class.
234+ @Deprecated (elementModelDeprecationMsg)
235+ abstract class AugmentedMixinElement extends AugmentedInterfaceElement {
236+ /// The superclass constraints of this element.
237+ ///
238+ /// This is a union of constraints declared by the class declaration and
239+ /// all its augmentations.
240+ List <InterfaceType > get superclassConstraints;
241+ }
242+
63243/// A pattern variable that is explicitly declared.
64244///
65245/// Clients may not extend, implement or mix-in this class.
@@ -74,6 +254,10 @@ abstract class BindPatternVariableElement implements PatternVariableElement {}
74254/// Clients may not extend, implement or mix-in this class.
75255@Deprecated ('Use ClassElement2 instead' )
76256abstract class ClassElement implements InterfaceElement {
257+ @Deprecated (elementModelDeprecationMsg)
258+ @override
259+ AugmentedClassElement get augmented ;
260+
77261 /// Whether the class or its superclass declares a non-final instance field.
78262 bool get hasNonFinalField;
79263
@@ -1079,7 +1263,11 @@ abstract class ElementVisitor<R> {
10791263///
10801264/// Clients may not extend, implement or mix-in this class.
10811265@Deprecated ('Use EnumElement2 instead' )
1082- abstract class EnumElement implements InterfaceElement {}
1266+ abstract class EnumElement implements InterfaceElement {
1267+ @Deprecated (elementModelDeprecationMsg)
1268+ @override
1269+ AugmentedEnumElement get augmented ;
1270+ }
10831271
10841272/// An element representing an executable object, including functions, methods,
10851273/// constructors, getters, and setters.
@@ -1150,6 +1338,10 @@ abstract class ExecutableElement implements FunctionTypedElement {
11501338/// Clients may not extend, implement or mix-in this class.
11511339@Deprecated ('Use ExtensionElement2 instead' )
11521340abstract class ExtensionElement implements InstanceElement {
1341+ @Deprecated (elementModelDeprecationMsg)
1342+ @override
1343+ AugmentedExtensionElement get augmented ;
1344+
11531345 /// The type that is extended by this extension.
11541346 DartType get extendedType;
11551347
@@ -1179,6 +1371,10 @@ abstract class ExtensionElement implements InstanceElement {
11791371/// Clients may not extend, implement or mix-in this class.
11801372@Deprecated ('Use ExtensionTypeElement2 instead' )
11811373abstract class ExtensionTypeElement implements InterfaceElement {
1374+ @Deprecated (elementModelDeprecationMsg)
1375+ @override
1376+ AugmentedExtensionTypeElement get augmented ;
1377+
11821378 /// The primary constructor of this extension.
11831379 @Deprecated (elementModelDeprecationMsg)
11841380 ConstructorElement get primaryConstructor;
@@ -1320,6 +1516,13 @@ abstract class InstanceElement
13201516 /// The declared accessors (getters and setters).
13211517 List <PropertyAccessorElement > get accessors;
13221518
1519+ /// The result of merging augmentations.
1520+ ///
1521+ /// It includes the members of the base element and its augmentations as
1522+ /// specified by the merge operations.
1523+ @Deprecated (elementModelDeprecationMsg)
1524+ AugmentedInstanceElement get augmented ;
1525+
13231526 @Deprecated (elementModelDeprecationMsg)
13241527 @override
13251528 CompilationUnitElement get enclosingElement3;
@@ -1351,6 +1554,10 @@ abstract class InterfaceElement implements InstanceElement {
13511554 /// This includes superclasses, mixins, interfaces, and superclass constraints.
13521555 List <InterfaceType > get allSupertypes;
13531556
1557+ @Deprecated (elementModelDeprecationMsg)
1558+ @override
1559+ AugmentedInterfaceElement get augmented ;
1560+
13541561 /// The declared constructors.
13551562 ///
13561563 /// The list is empty for [MixinElement] .
@@ -1838,6 +2045,10 @@ abstract class MethodElement implements ClassMemberElement, ExecutableElement {
18382045/// Clients may not extend, implement or mix-in this class.
18392046@Deprecated ('Use MixinElement2 instead' )
18402047abstract class MixinElement implements InterfaceElement {
2048+ @Deprecated (elementModelDeprecationMsg)
2049+ @override
2050+ AugmentedMixinElement get augmented ;
2051+
18412052 /// Whether the mixin is a base mixin.
18422053 ///
18432054 /// A mixin is a base mixin if it has an explicit `base` modifier.
0 commit comments