commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomjbr.41338...@bloglines.com
Subject Commons Discovery - how can you find all classes that implements your interface ?
Date Wed, 23 Jan 2008 21:40:39 GMT
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


Mime
View raw message