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

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

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

Powered by Google App Engine
This is Rietveld 408576698