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

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

Issue 15277005: Fixes for issues 10017 and 10161 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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
===================================================================
--- editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Annotation.java (revision 22889)
+++ editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Annotation.java (working copy)
@@ -13,6 +13,7 @@
*/
package com.google.dart.engine.ast;
+import com.google.dart.engine.element.Element;
import com.google.dart.engine.scanner.Token;
/**
@@ -120,6 +121,21 @@
return constructorName;
}
+ /**
+ * Return 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.
+ *
+ * @return the element associated with this annotation
+ */
+ public Element getElement() {
+ if (constructorName != null) {
+ return constructorName.getElement();
+ } else if (name != null) {
+ return name.getElement();
+ }
+ return null;
+ }
+
@Override
public Token getEndToken() {
if (arguments != null) {
« 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