Getting java.lang.Class from PsiClass

Is there any way i can the java.lang.Class instance from a PsiClass ?

Thanks...

3 comments
Comment actions Permalink

Not sure I get what you mean. java.lang.Class represents classes loaded into running JVM. PSI on the other hand is independent from loading classes. (Even for class files IDEA does not use reflective API, but uses its own class file parser).
Could you please provide more details on your usecase?

0
Comment actions Permalink

I understand that.
I just wanted to use a reflection library that works on the Class instance but now that i think about it with a few more hours of sleep it makes much more sense to use the PsiClass and use it's methods to get the metadata i want from the class.

Thanks again.....

0
Comment actions Permalink

If you don't need to instantiate your class, then PsiClass instance is enough:


The PsiClass provides reflection methods like getAllMethods().

0

Please sign in to leave a comment.