From: Ken A. <kan...@bb...> - 2003-11-18 15:49:30
|
At 02:05 PM 11/7/2003 +0100, Alex Greif wrote: >hi, >I have two questions concerning classspaths: > >- Is it possible to determine all classes in the complete classpath which implement a specific interface? Yes. If your ClassLoader is a subclass of URLClassLoader, which it often is, you can ask it for it's URL's with getURLs(), and get the URL's of its parent..., and get all the jars mentioned in the "sun.boot.class.path" System.property. Then read all the jars to get class names, then load all the classes and see which ones implement the interface you're interested in. I can send you code that does this if you're interested. >- is it possible to get a list of all classes/ interfaces in a package? I don't think Java reflection allows this, but you can use the above technique to find this information. >thanks >alex. >______________________________________________________________________________ >WEB.DE FreeMail wird 5 Jahre jung! Feiern Sie mit uns und >nutzen Sie die neuen Funktionen http://f.web.de/features/?mc=021130 > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >Does SourceForge.net help you be more productive? Does it >help you create better code? SHARE THE LOVE, and help us help >YOU! Click Here: http://sourceforge.net/donate/ >_______________________________________________ >Beanshell-users mailing list >Bea...@li... >https://lists.sourceforge.net/lists/listinfo/beanshell-users |