Match method signature

I am working on an inspection plugin that needs to identify specific method calls based on an xml file. The file contains methods listed as strings of the format: "packageHierarchy.class.method".

I searched through the forum (forgive me if I missed the answer somewhere), but I can't seem to find a way to extract an method's signature. Currently, I am working with a PsiMethodCallExpression and have been able to get the method name through getReferenceName(). Is there a similar way to extract the class and package?

I apologize if this is trivial. Thank you.

Comment actions Permalink

I figured it out on my own. I'm surprised at the lack of documentation.

For anyone who may need help with this in the future, from the PsiMethodCallExpression you can get the class name through resolveMethod().getContainignClass().getQualifiedName() and the method itself from getMethodExpression().getReferenceName().


Comment actions Permalink

cheers for posting the solution!



Please sign in to leave a comment.