views:

70

answers:

1

Hi, I have a problem I've been trying to solve for quite some hours. In an Eclipse plugin, I have an ArrayList that contains the full paths (as strings) of some java .class files. What I'd like to do is check if the classes that are included in the list extend a particular class. I thought about parsing the file, looking for what is after "extends," however we are talking about a .class file and not of a .java file. Any other ideas?

Thanks!

+5  A: 

Use an URLClassLoader to load the file (Problem: You would need to know the right parent folder and Package + ClassName) and use the normal java.lang.Class methods to check.

ZeissS
yes, i think then getClasses() is your friend
Redlab