Read annotations from PsiClass in intellij idea plugin

annotations, intellij-idea, intellij-plugin, java, plugins

Solution

I was able to read annotations from the PsiClass with the help of "com.intellij.codeInsight.AnnotationUtil"http://grepcode.com/file/repository.grepcode.com/java/ext/com.jetbrains/intellij-idea/12.0/com/intellij/codeInsight/AnnotationUtil.java...We can also try with this code :

PsiAnnotation[] annotation= modifierList.getAnnotations();

Problem

I want to read annotations from PsiClass in intellij idea plugin development.. Is there any API for that. I am not able to do this with reflections as psiClass can't be converted to java.lang.Class

Original source