You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by to...@bloglines.com on 2008/01/23 22:40:39 UTC

Commons Discovery - how can you find all classes that implements your interface ?

I found this 'Commons Discovery' component when I was googling to try to figure
out how to implement a method like this, which should locate all classes that
are available at the classpath that implements a certain interface:
'public
Class[] getImplementingClasses(Class someInterface)'
or even better (more
generic):
'public Class[] getSubtypes(Class someBaseType)'
(where basetype
can be either an interface or a baseclass, while a subtype can be a subclass
or subinterface)

It seems to me as this should be possible, considering
the following quote from the homepage:
"Fundamentally, Discovery locates
classes that implement a given Java interface."

However, I can not find
any code example about how to do this.

/ Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org