Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: analyzer/lib/src/generated/element_handle.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
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.
7
8 library engine.element_handle;
9
10 import 'ast.dart';
11 import 'element.dart';
12 import 'engine.dart';
13 import 'java_core.dart';
14 import 'java_engine.dart';
15 import 'resolver.dart';
16 import 'source.dart';
17 import 'utilities_dart.dart';
18
19 /**
20 * Instances of the class `ClassElementHandle` implement a handle to a `ClassEle ment`.
21 */
22 class ClassElementHandle extends ElementHandle implements ClassElement {
23 /**
24 * Initialize a newly created element handle to represent the given element.
25 *
26 * @param element the element being represented
27 */
28 ClassElementHandle(ClassElement element) : super(element);
29
30 @override
31 List<PropertyAccessorElement> get accessors => actualElement.accessors;
32
33 @override
34 ClassElement get actualElement => super.actualElement as ClassElement;
35
36 @override
37 List<InterfaceType> get allSupertypes => actualElement.allSupertypes;
38
39 @override
40 List<ConstructorElement> get constructors => actualElement.constructors;
41
42 @override
43 List<FieldElement> get fields => actualElement.fields;
44
45 @override
46 bool get hasNonFinalField => actualElement.hasNonFinalField;
47
48 @override
49 bool get hasReferenceToSuper => actualElement.hasReferenceToSuper;
50
51 @override
52 bool get hasStaticMember => actualElement.hasStaticMember;
53
54 @override
55 List<InterfaceType> get interfaces => actualElement.interfaces;
56
57 @override
58 bool get isAbstract => actualElement.isAbstract;
59
60 @override
61 bool get isEnum => actualElement.isEnum;
62
63 @override
64 bool get isMixinApplication => actualElement.isMixinApplication;
65
66 @override
67 bool get isOrInheritsProxy => actualElement.isOrInheritsProxy;
68
69 @override
70 bool get isProxy => actualElement.isProxy;
71
72 @override
73 @deprecated
74 bool get isTypedef => actualElement.isMixinApplication;
75
76 @override
77 bool get isValidMixin => actualElement.isValidMixin;
78
79 @override
80 ElementKind get kind => ElementKind.CLASS;
81
82 @override
83 List<MethodElement> get methods => actualElement.methods;
84
85 @override
86 List<InterfaceType> get mixins => actualElement.mixins;
87
88 @override
89 InterfaceType get supertype => actualElement.supertype;
90
91 @override
92 InterfaceType get type => actualElement.type;
93
94 @override
95 List<TypeParameterElement> get typeParameters => actualElement.typeParameters;
96
97 @override
98 ConstructorElement get unnamedConstructor => actualElement.unnamedConstructor;
99
100 @override
101 FieldElement getField(String fieldName) => actualElement.getField(fieldName);
102
103 @override
104 PropertyAccessorElement getGetter(String getterName) =>
105 actualElement.getGetter(getterName);
106
107 @override
108 MethodElement getMethod(String methodName) =>
109 actualElement.getMethod(methodName);
110
111 @override
112 ConstructorElement getNamedConstructor(String name) =>
113 actualElement.getNamedConstructor(name);
114
115 @override
116 PropertyAccessorElement getSetter(String setterName) =>
117 actualElement.getSetter(setterName);
118
119 @override
120 bool isSuperConstructorAccessible(ConstructorElement constructor) =>
121 actualElement.isSuperConstructorAccessible(constructor);
122
123 @override
124 MethodElement lookUpConcreteMethod(
125 String methodName, LibraryElement library) =>
126 actualElement.lookUpConcreteMethod(methodName, library);
127
128 @override
129 PropertyAccessorElement lookUpGetter(
130 String getterName, LibraryElement library) =>
131 actualElement.lookUpGetter(getterName, library);
132
133 @override
134 PropertyAccessorElement lookUpInheritedConcreteGetter(
135 String methodName, LibraryElement library) =>
136 actualElement.lookUpInheritedConcreteGetter(methodName, library);
137
138 @override
139 MethodElement lookUpInheritedConcreteMethod(
140 String methodName, LibraryElement library) =>
141 actualElement.lookUpInheritedConcreteMethod(methodName, library);
142
143 @override
144 PropertyAccessorElement lookUpInheritedConcreteSetter(
145 String methodName, LibraryElement library) =>
146 actualElement.lookUpInheritedConcreteSetter(methodName, library);
147
148 @override
149 MethodElement lookUpInheritedMethod(
150 String methodName, LibraryElement library) =>
151 actualElement.lookUpInheritedMethod(methodName, library);
152
153 @override
154 MethodElement lookUpMethod(String methodName, LibraryElement library) =>
155 actualElement.lookUpMethod(methodName, library);
156
157 @override
158 PropertyAccessorElement lookUpSetter(
159 String setterName, LibraryElement library) =>
160 actualElement.lookUpSetter(setterName, library);
161 }
162
163 /**
164 * Instances of the class `CompilationUnitElementHandle` implements a handle to a
165 * [CompilationUnitElement].
166 */
167 class CompilationUnitElementHandle extends ElementHandle
168 implements CompilationUnitElement {
169 /**
170 * Initialize a newly created element handle to represent the given element.
171 *
172 * @param element the element being represented
173 */
174 CompilationUnitElementHandle(CompilationUnitElement element) : super(element);
175
176 @override
177 List<PropertyAccessorElement> get accessors => actualElement.accessors;
178
179 @override
180 CompilationUnitElement get actualElement =>
181 super.actualElement as CompilationUnitElement;
182
183 @override
184 LibraryElement get enclosingElement =>
185 super.enclosingElement as LibraryElement;
186
187 @override
188 List<ClassElement> get enums => actualElement.enums;
189
190 @override
191 List<FunctionElement> get functions => actualElement.functions;
192
193 @override
194 List<FunctionTypeAliasElement> get functionTypeAliases =>
195 actualElement.functionTypeAliases;
196
197 @override
198 bool get hasLoadLibraryFunction => actualElement.hasLoadLibraryFunction;
199
200 @override
201 ElementKind get kind => ElementKind.COMPILATION_UNIT;
202
203 @override
204 Source get source => actualElement.source;
205
206 @override
207 List<TopLevelVariableElement> get topLevelVariables =>
208 actualElement.topLevelVariables;
209
210 @override
211 List<ClassElement> get types => actualElement.types;
212
213 @override
214 String get uri => actualElement.uri;
215
216 @override
217 int get uriEnd => actualElement.uriEnd;
218
219 @override
220 int get uriOffset => actualElement.uriOffset;
221
222 @override
223 CompilationUnit computeNode() => actualElement.computeNode();
224
225 @override
226 Element getElementAt(int offset) {
227 return actualElement.getElementAt(offset);
228 }
229
230 @override
231 ClassElement getEnum(String enumName) => actualElement.getEnum(enumName);
232
233 @override
234 ClassElement getType(String className) => actualElement.getType(className);
235 }
236
237 /**
238 * Instances of the class `ConstructorElementHandle` implement a handle to a
239 * `ConstructorElement`.
240 */
241 class ConstructorElementHandle extends ExecutableElementHandle
242 implements ConstructorElement {
243 /**
244 * Initialize a newly created element handle to represent the given element.
245 *
246 * @param element the element being represented
247 */
248 ConstructorElementHandle(ConstructorElement element) : super(element);
249
250 @override
251 ConstructorElement get actualElement =>
252 super.actualElement as ConstructorElement;
253
254 @override
255 ClassElement get enclosingElement => actualElement.enclosingElement;
256
257 @override
258 bool get isConst => actualElement.isConst;
259
260 @override
261 bool get isDefaultConstructor => actualElement.isDefaultConstructor;
262
263 @override
264 bool get isFactory => actualElement.isFactory;
265
266 @override
267 ElementKind get kind => ElementKind.CONSTRUCTOR;
268
269 @override
270 int get nameEnd => actualElement.nameEnd;
271
272 @override
273 int get periodOffset => actualElement.periodOffset;
274
275 @override
276 ConstructorElement get redirectedConstructor =>
277 actualElement.redirectedConstructor;
278
279 @override
280 ConstructorDeclaration computeNode() => actualElement.computeNode();
281 }
282
283 /**
284 * The abstract class `ElementHandle` implements the behavior common to objects that implement
285 * a handle to an [Element].
286 */
287 abstract class ElementHandle implements Element {
288 /**
289 * The unique integer identifier of this element.
290 */
291 final int id = 0;
292
293 /**
294 * The context in which the element is defined.
295 */
296 AnalysisContext _context;
297
298 /**
299 * The location of this element, used to reconstitute the element if it has be en garbage
300 * collected.
301 */
302 ElementLocation _location;
303
304 /**
305 * A reference to the element being referenced by this handle, or `null` if th e element has
306 * been garbage collected.
307 */
308 WeakReference<Element> _elementReference;
309
310 /**
311 * Initialize a newly created element handle to represent the given element.
312 *
313 * @param element the element being represented
314 */
315 ElementHandle(Element element) {
316 _context = element.context;
317 _location = element.location;
318 _elementReference = new WeakReference<Element>(element);
319 }
320
321 /**
322 * Return the element being represented by this handle, reconstituting the ele ment if the
323 * reference has been set to `null`.
324 *
325 * @return the element being represented by this handle
326 */
327 Element get actualElement {
328 Element element = _elementReference.get();
329 if (element == null) {
330 element = _context.getElement(_location);
331 _elementReference = new WeakReference<Element>(element);
332 }
333 return element;
334 }
335
336 @override
337 AnalysisContext get context => _context;
338
339 @override
340 String get displayName => actualElement.displayName;
341
342 @override
343 Element get enclosingElement => actualElement.enclosingElement;
344
345 @override
346 int get hashCode => _location.hashCode;
347
348 @override
349 bool get isDeprecated => actualElement.isDeprecated;
350
351 @override
352 bool get isOverride => actualElement.isOverride;
353
354 @override
355 bool get isPrivate => actualElement.isPrivate;
356
357 @override
358 bool get isPublic => actualElement.isPublic;
359
360 @override
361 bool get isSynthetic => actualElement.isSynthetic;
362
363 @override
364 LibraryElement get library =>
365 getAncestor((element) => element is LibraryElement);
366
367 @override
368 ElementLocation get location => _location;
369
370 @override
371 List<ElementAnnotation> get metadata => actualElement.metadata;
372
373 @override
374 String get name => actualElement.name;
375
376 @override
377 int get nameOffset => actualElement.nameOffset;
378
379 @deprecated
380 @override
381 AstNode get node => computeNode();
382
383 @override
384 Source get source => actualElement.source;
385
386 @override
387 CompilationUnit get unit => actualElement.unit;
388
389 @override
390 bool operator ==(Object object) =>
391 object is Element && object.location == _location;
392
393 @override
394 accept(ElementVisitor visitor) => actualElement.accept(visitor);
395
396 @override
397 String computeDocumentationComment() =>
398 actualElement.computeDocumentationComment();
399
400 @override
401 AstNode computeNode() => actualElement.computeNode();
402
403 @override
404 Element getAncestor(Predicate<Element> predicate) =>
405 actualElement.getAncestor(predicate);
406
407 @override
408 String getExtendedDisplayName(String shortName) =>
409 actualElement.getExtendedDisplayName(shortName);
410
411 @override
412 bool isAccessibleIn(LibraryElement library) =>
413 actualElement.isAccessibleIn(library);
414
415 @override
416 void visitChildren(ElementVisitor visitor) {
417 actualElement.visitChildren(visitor);
418 }
419
420 /**
421 * Return a handle on the given element. If the element is already a handle, t hen it will be
422 * returned directly, otherwise a handle of the appropriate class will be cons tructed.
423 *
424 * @param element the element for which a handle is to be constructed
425 * @return a handle on the given element
426 */
427 static Element forElement(Element element) {
428 if (element is ElementHandle) {
429 return element;
430 }
431 while (true) {
432 if (element.kind == ElementKind.CLASS) {
433 return new ClassElementHandle(element as ClassElement);
434 } else if (element.kind == ElementKind.COMPILATION_UNIT) {
435 return new CompilationUnitElementHandle(
436 element as CompilationUnitElement);
437 } else if (element.kind == ElementKind.CONSTRUCTOR) {
438 return new ConstructorElementHandle(element as ConstructorElement);
439 } else if (element.kind == ElementKind.EXPORT) {
440 return new ExportElementHandle(element as ExportElement);
441 } else if (element.kind == ElementKind.FIELD) {
442 return new FieldElementHandle(element as FieldElement);
443 } else if (element.kind == ElementKind.FUNCTION) {
444 return new FunctionElementHandle(element as FunctionElement);
445 } else if (element.kind == ElementKind.GETTER) {
446 return new PropertyAccessorElementHandle(
447 element as PropertyAccessorElement);
448 } else if (element.kind == ElementKind.IMPORT) {
449 return new ImportElementHandle(element as ImportElement);
450 } else if (element.kind == ElementKind.LABEL) {
451 return new LabelElementHandle(element as LabelElement);
452 } else if (element.kind == ElementKind.LIBRARY) {
453 return new LibraryElementHandle(element as LibraryElement);
454 } else if (element.kind == ElementKind.LOCAL_VARIABLE) {
455 return new LocalVariableElementHandle(element as LocalVariableElement);
456 } else if (element.kind == ElementKind.METHOD) {
457 return new MethodElementHandle(element as MethodElement);
458 } else if (element.kind == ElementKind.PARAMETER) {
459 return new ParameterElementHandle(element as ParameterElement);
460 } else if (element.kind == ElementKind.PREFIX) {
461 return new PrefixElementHandle(element as PrefixElement);
462 } else if (element.kind == ElementKind.SETTER) {
463 return new PropertyAccessorElementHandle(
464 element as PropertyAccessorElement);
465 } else if (element.kind == ElementKind.TOP_LEVEL_VARIABLE) {
466 return new TopLevelVariableElementHandle(
467 element as TopLevelVariableElement);
468 } else if (element.kind == ElementKind.FUNCTION_TYPE_ALIAS) {
469 return new FunctionTypeAliasElementHandle(
470 element as FunctionTypeAliasElement);
471 } else if (element.kind == ElementKind.TYPE_PARAMETER) {
472 return new TypeParameterElementHandle(element as TypeParameterElement);
473 } else {
474 throw new UnsupportedOperationException();
475 }
476 break;
477 }
478 }
479
480 /**
481 * Return an array of the same size as the given array where each element of t he returned array is
482 * a handle for the corresponding element of the given array.
483 *
484 * @param elements the elements for which handles are to be created
485 * @return an array of handles to the given elements
486 */
487 static List<Element> forElements(List<Element> elements) {
488 int length = elements.length;
489 List<Element> handles = new List<Element>.from(elements);
490 for (int i = 0; i < length; i++) {
491 handles[i] = forElement(elements[i]);
492 }
493 return handles;
494 }
495 }
496
497 /**
498 * The abstract class `ExecutableElementHandle` implements the behavior common t o objects that
499 * implement a handle to an [ExecutableElement].
500 */
501 abstract class ExecutableElementHandle extends ElementHandle
502 implements ExecutableElement {
503 /**
504 * Initialize a newly created element handle to represent the given element.
505 *
506 * @param element the element being represented
507 */
508 ExecutableElementHandle(ExecutableElement element) : super(element);
509
510 @override
511 ExecutableElement get actualElement =>
512 super.actualElement as ExecutableElement;
513
514 @override
515 List<FunctionElement> get functions => actualElement.functions;
516
517 @override
518 bool get isAbstract => actualElement.isAbstract;
519
520 @override
521 bool get isAsynchronous => actualElement.isAsynchronous;
522
523 @override
524 bool get isExternal => actualElement.isExternal;
525
526 @override
527 bool get isGenerator => actualElement.isGenerator;
528
529 @override
530 bool get isOperator => actualElement.isOperator;
531
532 @override
533 bool get isStatic => actualElement.isStatic;
534
535 @override
536 bool get isSynchronous => actualElement.isSynchronous;
537
538 @override
539 List<LabelElement> get labels => actualElement.labels;
540
541 @override
542 List<LocalVariableElement> get localVariables => actualElement.localVariables;
543
544 @override
545 List<ParameterElement> get parameters => actualElement.parameters;
546
547 @override
548 DartType get returnType => actualElement.returnType;
549
550 @override
551 FunctionType get type => actualElement.type;
552
553 @override
554 List<TypeParameterElement> get typeParameters => actualElement.typeParameters;
555 }
556
557 /**
558 * Instances of the class `ExportElementHandle` implement a handle to an `Export Element`
559 * .
560 */
561 class ExportElementHandle extends ElementHandle implements ExportElement {
562 /**
563 * Initialize a newly created element handle to represent the given element.
564 *
565 * @param element the element being represented
566 */
567 ExportElementHandle(ExportElement element) : super(element);
568
569 @override
570 ExportElement get actualElement => super.actualElement as ExportElement;
571
572 @override
573 List<NamespaceCombinator> get combinators => actualElement.combinators;
574
575 @override
576 LibraryElement get exportedLibrary => actualElement.exportedLibrary;
577
578 @override
579 ElementKind get kind => ElementKind.EXPORT;
580
581 @override
582 String get uri => actualElement.uri;
583
584 @override
585 int get uriEnd => actualElement.uriEnd;
586
587 @override
588 int get uriOffset => actualElement.uriOffset;
589 }
590
591 /**
592 * Instances of the class `FieldElementHandle` implement a handle to a `FieldEle ment`.
593 */
594 class FieldElementHandle extends PropertyInducingElementHandle
595 implements FieldElement {
596 /**
597 * Initialize a newly created element handle to represent the given element.
598 *
599 * @param element the element being represented
600 */
601 FieldElementHandle(FieldElement element) : super(element);
602
603 @override
604 FieldElement get actualElement => super.actualElement as FieldElement;
605
606 @override
607 ClassElement get enclosingElement => actualElement.enclosingElement;
608
609 @override
610 bool get isEnumConstant => actualElement.isEnumConstant;
611
612 @override
613 bool get isStatic => actualElement.isStatic;
614
615 @override
616 ElementKind get kind => ElementKind.FIELD;
617
618 @override
619 VariableDeclaration computeNode() => actualElement.computeNode();
620 }
621
622 /**
623 * Instances of the class `FunctionElementHandle` implement a handle to a
624 * `FunctionElement`.
625 */
626 class FunctionElementHandle extends ExecutableElementHandle
627 implements FunctionElement {
628 /**
629 * Initialize a newly created element handle to represent the given element.
630 *
631 * @param element the element being represented
632 */
633 FunctionElementHandle(FunctionElement element) : super(element);
634
635 @override
636 FunctionElement get actualElement => super.actualElement as FunctionElement;
637
638 @override
639 bool get isEntryPoint => actualElement.isEntryPoint;
640
641 @override
642 ElementKind get kind => ElementKind.FUNCTION;
643
644 @override
645 SourceRange get visibleRange => actualElement.visibleRange;
646
647 @override
648 FunctionDeclaration computeNode() => actualElement.computeNode();
649 }
650
651 /**
652 * Instances of the class `FunctionTypeAliasElementHandle` implement a handle to a
653 * `FunctionTypeAliasElement`.
654 */
655 class FunctionTypeAliasElementHandle extends ElementHandle
656 implements FunctionTypeAliasElement {
657 /**
658 * Initialize a newly created element handle to represent the given element.
659 *
660 * @param element the element being represented
661 */
662 FunctionTypeAliasElementHandle(FunctionTypeAliasElement element)
663 : super(element);
664
665 @override
666 FunctionTypeAliasElement get actualElement =>
667 super.actualElement as FunctionTypeAliasElement;
668
669 @override
670 CompilationUnitElement get enclosingElement =>
671 super.enclosingElement as CompilationUnitElement;
672
673 @override
674 ElementKind get kind => ElementKind.FUNCTION_TYPE_ALIAS;
675
676 @override
677 List<ParameterElement> get parameters => actualElement.parameters;
678
679 @override
680 DartType get returnType => actualElement.returnType;
681
682 @override
683 FunctionType get type => actualElement.type;
684
685 @override
686 List<TypeParameterElement> get typeParameters => actualElement.typeParameters;
687
688 @override
689 FunctionTypeAlias computeNode() => actualElement.computeNode();
690 }
691
692 /**
693 * Instances of the class `ImportElementHandle` implement a handle to an `Import Element`
694 * .
695 */
696 class ImportElementHandle extends ElementHandle implements ImportElement {
697 /**
698 * Initialize a newly created element handle to represent the given element.
699 *
700 * @param element the element being represented
701 */
702 ImportElementHandle(ImportElement element) : super(element);
703
704 @override
705 ImportElement get actualElement => super.actualElement as ImportElement;
706
707 @override
708 List<NamespaceCombinator> get combinators => actualElement.combinators;
709
710 @override
711 LibraryElement get importedLibrary => actualElement.importedLibrary;
712
713 @override
714 bool get isDeferred => actualElement.isDeferred;
715
716 @override
717 ElementKind get kind => ElementKind.IMPORT;
718
719 @override
720 PrefixElement get prefix => actualElement.prefix;
721
722 @override
723 int get prefixOffset => actualElement.prefixOffset;
724
725 @override
726 String get uri => actualElement.uri;
727
728 @override
729 int get uriEnd => actualElement.uriEnd;
730
731 @override
732 int get uriOffset => actualElement.uriOffset;
733 }
734
735 /**
736 * Instances of the class `LabelElementHandle` implement a handle to a `LabelEle ment`.
737 */
738 class LabelElementHandle extends ElementHandle implements LabelElement {
739 /**
740 * Initialize a newly created element handle to represent the given element.
741 *
742 * @param element the element being represented
743 */
744 LabelElementHandle(LabelElement element) : super(element);
745
746 @override
747 ExecutableElement get enclosingElement =>
748 super.enclosingElement as ExecutableElement;
749
750 @override
751 ElementKind get kind => ElementKind.LABEL;
752 }
753
754 /**
755 * Instances of the class `LibraryElementHandle` implement a handle to a
756 * `LibraryElement`.
757 */
758 class LibraryElementHandle extends ElementHandle implements LibraryElement {
759 /**
760 * Initialize a newly created element handle to represent the given element.
761 *
762 * @param element the element being represented
763 */
764 LibraryElementHandle(LibraryElement element) : super(element);
765
766 @override
767 LibraryElement get actualElement => super.actualElement as LibraryElement;
768
769 @override
770 CompilationUnitElement get definingCompilationUnit =>
771 actualElement.definingCompilationUnit;
772
773 @override
774 FunctionElement get entryPoint => actualElement.entryPoint;
775
776 @override
777 List<LibraryElement> get exportedLibraries => actualElement.exportedLibraries;
778
779 @override
780 Namespace get exportNamespace => actualElement.exportNamespace;
781
782 @override
783 List<ExportElement> get exports => actualElement.exports;
784
785 @override
786 bool get hasExtUri => actualElement.hasExtUri;
787
788 @override
789 bool get hasLoadLibraryFunction => actualElement.hasLoadLibraryFunction;
790
791 @override
792 List<LibraryElement> get importedLibraries => actualElement.importedLibraries;
793
794 @override
795 List<ImportElement> get imports => actualElement.imports;
796
797 @override
798 bool get isBrowserApplication => actualElement.isBrowserApplication;
799
800 @override
801 bool get isDartCore => actualElement.isDartCore;
802
803 @override
804 bool get isInSdk => actualElement.isInSdk;
805
806 @override
807 ElementKind get kind => ElementKind.LIBRARY;
808
809 @override
810 FunctionElement get loadLibraryFunction => actualElement.loadLibraryFunction;
811
812 @override
813 List<CompilationUnitElement> get parts => actualElement.parts;
814
815 @override
816 List<PrefixElement> get prefixes => actualElement.prefixes;
817
818 @override
819 Namespace get publicNamespace => actualElement.publicNamespace;
820
821 @override
822 List<CompilationUnitElement> get units => actualElement.units;
823
824 @override
825 List<LibraryElement> get visibleLibraries => actualElement.visibleLibraries;
826
827 @override
828 List<ImportElement> getImportsWithPrefix(PrefixElement prefixElement) =>
829 actualElement.getImportsWithPrefix(prefixElement);
830
831 @override
832 ClassElement getType(String className) => actualElement.getType(className);
833
834 @override
835 bool isUpToDate(int timeStamp) => actualElement.isUpToDate(timeStamp);
836 }
837
838 /**
839 * Instances of the class `LocalVariableElementHandle` implement a handle to a
840 * `LocalVariableElement`.
841 */
842 class LocalVariableElementHandle extends VariableElementHandle
843 implements LocalVariableElement {
844 /**
845 * Initialize a newly created element handle to represent the given element.
846 *
847 * @param element the element being represented
848 */
849 LocalVariableElementHandle(LocalVariableElement element) : super(element);
850
851 @override
852 LocalVariableElement get actualElement =>
853 super.actualElement as LocalVariableElement;
854
855 @override
856 ElementKind get kind => ElementKind.LOCAL_VARIABLE;
857
858 @override
859 SourceRange get visibleRange => actualElement.visibleRange;
860
861 @override
862 VariableDeclaration computeNode() => actualElement.computeNode();
863 }
864
865 /**
866 * Instances of the class `MethodElementHandle` implement a handle to a `MethodE lement`.
867 */
868 class MethodElementHandle extends ExecutableElementHandle
869 implements MethodElement {
870 /**
871 * Initialize a newly created element handle to represent the given element.
872 *
873 * @param element the element being represented
874 */
875 MethodElementHandle(MethodElement element) : super(element);
876
877 @override
878 MethodElement get actualElement => super.actualElement as MethodElement;
879
880 @override
881 ClassElement get enclosingElement => super.enclosingElement as ClassElement;
882
883 @override
884 bool get isStatic => actualElement.isStatic;
885
886 @override
887 ElementKind get kind => ElementKind.METHOD;
888
889 @override
890 MethodDeclaration computeNode() => actualElement.computeNode();
891 }
892
893 /**
894 * Instances of the class `ParameterElementHandle` implement a handle to a
895 * `ParameterElement`.
896 */
897 class ParameterElementHandle extends VariableElementHandle
898 implements ParameterElement {
899 /**
900 * Initialize a newly created element handle to represent the given element.
901 *
902 * @param element the element being represented
903 */
904 ParameterElementHandle(ParameterElement element) : super(element);
905
906 @override
907 ParameterElement get actualElement => super.actualElement as ParameterElement;
908
909 @override
910 String get defaultValueCode => actualElement.defaultValueCode;
911
912 @override
913 bool get isInitializingFormal => actualElement.isInitializingFormal;
914
915 @override
916 ElementKind get kind => ElementKind.PARAMETER;
917
918 @override
919 ParameterKind get parameterKind => actualElement.parameterKind;
920
921 @override
922 List<ParameterElement> get parameters => actualElement.parameters;
923
924 @override
925 List<TypeParameterElement> get typeParameters => actualElement.typeParameters;
926
927 @override
928 SourceRange get visibleRange => actualElement.visibleRange;
929 }
930
931 /**
932 * Instances of the class `PrefixElementHandle` implement a handle to a `PrefixE lement`.
933 */
934 class PrefixElementHandle extends ElementHandle implements PrefixElement {
935 /**
936 * Initialize a newly created element handle to represent the given element.
937 *
938 * @param element the element being represented
939 */
940 PrefixElementHandle(PrefixElement element) : super(element);
941
942 @override
943 PrefixElement get actualElement => super.actualElement as PrefixElement;
944
945 @override
946 LibraryElement get enclosingElement =>
947 super.enclosingElement as LibraryElement;
948
949 @override
950 List<LibraryElement> get importedLibraries => actualElement.importedLibraries;
951
952 @override
953 ElementKind get kind => ElementKind.PREFIX;
954 }
955
956 /**
957 * Instances of the class `PropertyAccessorElementHandle` implement a handle to a
958 * `PropertyAccessorElement`.
959 */
960 class PropertyAccessorElementHandle extends ExecutableElementHandle
961 implements PropertyAccessorElement {
962 /**
963 * Initialize a newly created element handle to represent the given element.
964 *
965 * @param element the element being represented
966 */
967 PropertyAccessorElementHandle(PropertyAccessorElement element)
968 : super(element);
969
970 @override
971 PropertyAccessorElement get actualElement =>
972 super.actualElement as PropertyAccessorElement;
973
974 @override
975 PropertyAccessorElement get correspondingGetter =>
976 actualElement.correspondingGetter;
977
978 @override
979 PropertyAccessorElement get correspondingSetter =>
980 actualElement.correspondingSetter;
981
982 @override
983 bool get isGetter => actualElement.isGetter;
984
985 @override
986 bool get isSetter => actualElement.isSetter;
987
988 @override
989 ElementKind get kind {
990 if (isGetter) {
991 return ElementKind.GETTER;
992 } else {
993 return ElementKind.SETTER;
994 }
995 }
996
997 @override
998 PropertyInducingElement get variable => actualElement.variable;
999 }
1000
1001 /**
1002 * The abstract class `PropertyInducingElementHandle` implements the behavior co mmon to
1003 * objects that implement a handle to an `PropertyInducingElement`.
1004 */
1005 abstract class PropertyInducingElementHandle extends VariableElementHandle
1006 implements PropertyInducingElement {
1007 /**
1008 * Initialize a newly created element handle to represent the given element.
1009 *
1010 * @param element the element being represented
1011 */
1012 PropertyInducingElementHandle(PropertyInducingElement element)
1013 : super(element);
1014
1015 @override
1016 PropertyInducingElement get actualElement =>
1017 super.actualElement as PropertyInducingElement;
1018
1019 @override
1020 PropertyAccessorElement get getter => actualElement.getter;
1021
1022 @override
1023 bool get isStatic => actualElement.isStatic;
1024
1025 @override
1026 DartType get propagatedType => actualElement.propagatedType;
1027
1028 @override
1029 PropertyAccessorElement get setter => actualElement.setter;
1030 }
1031
1032 /**
1033 * Instances of the class `TopLevelVariableElementHandle` implement a handle to a
1034 * `TopLevelVariableElement`.
1035 */
1036 class TopLevelVariableElementHandle extends PropertyInducingElementHandle
1037 implements TopLevelVariableElement {
1038 /**
1039 * Initialize a newly created element handle to represent the given element.
1040 *
1041 * @param element the element being represented
1042 */
1043 TopLevelVariableElementHandle(TopLevelVariableElement element)
1044 : super(element);
1045
1046 @override
1047 ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE;
1048 }
1049
1050 /**
1051 * Instances of the class `TypeParameterElementHandle` implement a handle to a
1052 * [TypeParameterElement].
1053 */
1054 class TypeParameterElementHandle extends ElementHandle
1055 implements TypeParameterElement {
1056 /**
1057 * Initialize a newly created element handle to represent the given element.
1058 *
1059 * @param element the element being represented
1060 */
1061 TypeParameterElementHandle(TypeParameterElement element) : super(element);
1062
1063 @override
1064 TypeParameterElement get actualElement =>
1065 super.actualElement as TypeParameterElement;
1066
1067 @override
1068 DartType get bound => actualElement.bound;
1069
1070 @override
1071 ElementKind get kind => ElementKind.TYPE_PARAMETER;
1072
1073 @override
1074 TypeParameterType get type => actualElement.type;
1075 }
1076
1077 /**
1078 * The abstract class `VariableElementHandle` implements the behavior common to objects that
1079 * implement a handle to an `VariableElement`.
1080 */
1081 abstract class VariableElementHandle extends ElementHandle
1082 implements VariableElement {
1083 /**
1084 * Initialize a newly created element handle to represent the given element.
1085 *
1086 * @param element the element being represented
1087 */
1088 VariableElementHandle(VariableElement element) : super(element);
1089
1090 @override
1091 VariableElement get actualElement => super.actualElement as VariableElement;
1092
1093 @override
1094 FunctionElement get initializer => actualElement.initializer;
1095
1096 @override
1097 bool get isConst => actualElement.isConst;
1098
1099 @override
1100 bool get isFinal => actualElement.isFinal;
1101
1102 @override
1103 bool get isPotentiallyMutatedInClosure =>
1104 actualElement.isPotentiallyMutatedInClosure;
1105
1106 @override
1107 bool get isPotentiallyMutatedInScope =>
1108 actualElement.isPotentiallyMutatedInScope;
1109
1110 @override
1111 DartType get type => actualElement.type;
1112 }
1113 /**
1114 * TODO(scheglov) invalid implementation
1115 */
1116 class WeakReference<T> {
1117 final T value;
1118 WeakReference(this.value);
1119 T get() => value;
1120 }
OLDNEW
« no previous file with comments | « analyzer/lib/src/generated/element.dart ('k') | analyzer/lib/src/generated/element_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698