I'm using the Eclipse JDT API and I have an IType. I'd like to discover all "dependencies" of this IType.
I think this would be:
- direct imports (import statements)
- as well full qualifier usage within the method signatures
- above information from supertypes
I am ignoring runtime dependency discovery right now. My goal is to come up with a QuickFix for "indirectly referenced from class file" for a setup with strict classpaths (no transitive dependencies).
One more complication: the type itself or supertypes could come from a jar without source attachment.
I'll probably need to produce the AST for this as this answer recommends. Any tips for the approach? Do I need to walk the full type? Is there another way to just get all the bindings and use them? Would that work?
I ended up implementing it in the following way. It does require a bit of recursion in order to follow all the method signatures of a type.
With a couple supporting methods: