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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Annotation.java

Issue 17586002: Resolve @Type.constructorName() and its arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Resolve @A() - unnamed constructor invocation. Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ElementResolver.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Annotation.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Annotation.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Annotation.java
index dbe078bed4a7d78689e47d62054c142224221951..f0e02c8b4e7879df25c9f9f86a922518f7cdce71 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Annotation.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Annotation.java
@@ -61,6 +61,12 @@ public class Annotation extends ASTNode {
private ArgumentList arguments;
/**
+ * The element associated with this annotation, or {@code null} if the AST structure has not been
+ * resolved or if this annotation could not be resolved.
+ */
+ private Element element;
+
+ /**
* Initialize a newly created annotation.
*
* @param atSign the at sign that introduced the annotation
@@ -128,9 +134,10 @@ public class Annotation extends ASTNode {
* @return the element associated with this annotation
*/
public Element getElement() {
- if (constructorName != null) {
- return constructorName.getElement();
- } else if (name != null) {
+ if (element != null) {
+ return element;
+ }
+ if (name != null) {
return name.getElement();
}
return null;
@@ -194,6 +201,15 @@ public class Annotation extends ASTNode {
}
/**
+ * Set the element associated with this annotation based.
+ *
+ * @param element the element to be associated with this identifier
+ */
+ public void setElement(Element element) {
+ this.element = element;
+ }
+
+ /**
* Set the name of the class defining the constructor that is being invoked or the name of the
* field that is being referenced to the given name.
*
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ElementResolver.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698