PsiTree/Annotation Search - working Samples?

Hey,

I need to search java files for Annotations and the appropiate class definitions, operations and attributes.
Or maybe just find different PsiElements...

found this out there:
http://devnet.jetbrains.net/message/5080869#5080869

But this (red) is not working. PsiManager aint got this.
    PsiClass nameAnnotation = psiManager.findClass("org.jboss.seam.annotations.Name");


Can Someone Help?

Yours Sincerly

3 comments
Comment actions Permalink

You have to use

com.intellij.psi.JavaPsiFacade#getInstance()#findClass()

instead.

What kind of functionality do you want to provide exactly? Maybe there's a better way then.

0
Comment actions Permalink

Hello Yann,

thank you for the quick answer. Your hint was very helpful.

Currently iam working on a Plugin which will be primary focus of my Bachelor Thesis.
The leading Tag is Round Trip Engineering.
The Aaim is to detect any changes in existing classes, operations and attributes and update them in the corresponding model.

classes, operations and attributes are tagged with annotations providing identifiers for the model.

So iam counting two working packages belonging to IntelliJ :
-detect changes
-collect information from files

As iam new to IntelliJ any help or further hints are badly welcome.
I already found the samples for PlugIn development. But they are a bit thin.
Are there more Samples somewhere?

Yours Sincerly

0
Comment actions Permalink

The best source for such functionality is probably Community Edition itself, you can download the sources as described here http://www.jetbrains.org/pages/viewpage.action?pageId=983225

The FAQ section at http://confluence.jetbrains.net/display/IDEADEV/PluginDevelopment is also a good starting point.

Feel free to ask here if you need any help. Good luck with your thesis!

0

Please sign in to leave a comment.