finding implementations of an interface programmatically
Hi... would anyone know how to find programmatically all classes that implement an interface?
Ideally, I would like to query on an interface and end up with a list of Class objects (i.e. the implementations of said interface).
Thanks
:)
Message was edited by:
javaBoy
[305 byte] By [
javaBoya] at [2007-11-26 12:23:02]

# 3
>can't be done. this gets asked all the time, and it's impossible.
Yes - technically correct.
However, in many contexts where you know what classloaders are at play (and lets face it, many of us do work on projects where we use known classloaders, and dont have some random loading off the net on demand going on), it is possible, useful, and very much do-able - if you accept the limitations and constraints.
So, OP, do a search and you'll probably find something useful to you.
~D
# 4
You search for Interface in any of the java files under the project like in eclipse search you have rebuild that
1. programmatically searching all the folders in the application for interface name in the implements clause of any java file
2. List all the names of the class which are matching the above
We need to write code for the 1.
Regards
R. Prasanna