PsiTree/Annotation Search - working Samples?


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:

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

Can Someone Help?

Yours Sincerly

Comment actions Permalink

You have to use



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

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

Comment actions Permalink

The best source for such functionality is probably Community Edition itself, you can download the sources as described here

The FAQ section at is also a good starting point.

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


Please sign in to leave a comment.