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

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

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

Powered by Google App Engine
This is Rietveld 408576698