What is the best way to find an interface for Java classes [message #506476] |
Thu, 07 January 2010 06:28  |
Eclipse User |
|
|
|
Hi All,
I have a workspace which contains a lot of Java classes, for those Java classes, I need to find out those that implements/extends a particular interface. since my code is performance sensitive, I need to find out the fastest way for doing this search. I've tried some APIs:
1. IType.getSuperInterfaceNames(),
this one only returns the direct interfaces (not working for me)
2. ITypeHierarchy hierarchy = classType.newSupertypeHierarchy(null);
IType[] interfaces = hierarchy.getAllInterfaces();
This one works for me, but my question is will "newSupertypeHierarchy" be expensive when doing the search for each class?
Does any one know any other better ways? Thanks for your help and appreciate it.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04748 seconds