Prateek baheti
Prateek baheti

Reputation: 23

Finding all Annotations in IProject in an Eclipse plugin

I need to find all the Annotations of a particular type from an IProject in an Eclipse plugin on the trigger on an action. The only approach I could find would be to find all java files in the project, create AST trees for each and then search the compilation units for the annotation.

Is there any simpler efficient way of doing this ? Even if we could find all annotations in the IProject, it would make it simpler.

Upvotes: 0

Views: 85

Answers (1)

greg-449
greg-449

Reputation: 111142

Core Eclipse doesn't know anything about the contents of Java files so I think the JDT Abstract Syntax Tree is the way to go. JDT keeps lots of information in indexes in the metadata to speed up the AST.

Upvotes: 1

Related Questions