Just wondering which tool / approach can solve the following issue easily / with less effort? The need is to invoke via ANT script.
The eclipse workspace has a couple of projects, say projectA - projectO (15 in number). Most of them are Java Projects. The point here I need to gather some data without using the eclipse IDE, rather through programmatically.
In projectA, which is a java project, has an Interface, say InterFaceA, which is being implemented in various other projects.
The point is I need to list out all the classes from all the 15 projects which have implemented the InterfaceA.
I came across couple of tools, like extending the Javadoc, eclipse AST, javaCC, ANTLR, but not finding a readymade solution.
Thought of below approaches, but finding it hard to implement.
- Find out all the variables declared, field, method level, i.e. throughout the java file / class and find out their type and among them find out the class that implements the InterfaceA.
- Do something like eclipse find references in the whole workspace for the interfaceA, but through code? Would appreciate if I get the source how eclipse does that so fast.
Can I request for a direct solution, may be using eclipse AST to get this done in a nice and intuitive manner?
P.S.: The existing code isn't neatly maintained. So, the possibilities are like the interfaceA may NOT have been declared with an instance variable, but just used as a local variable just before it's being used and so on. Plus there are many inner classes, etc.
Thanks in advance.