Scanning for use of imported classes within code

Hi all,

I have developed a custom-rule that raises a code-smell if a certain class is imported.

The only problem is, if the whole package is imported (org.package.*), I need to still be able to identify if the forbidden class is being used in the code.

My plan was to create another rule that scans for uses of the class within the code. Any ideas how to do this?

I have tried using the MethodInvocationTree but unsure how to get the parent class name