Article View: borland.public.jbuilder.java.api
Article #1460Re: How to find all Classes in a Package?
From: John McGrath TeamB
Date: Wed, 12 Dec 2001 19:23
Date: Wed, 12 Dec 2001 19:23
19 lines
1512 bytes
1512 bytes
On Wed, 12 Dec 2001 12:11:17 -0600, Tim Perrigo wrote:
> Can anyone tell me how to retrieve a list (array or Collection)
> of all Classes (java.lang.Class) in a particular package? Any
> help would be much appreciated!
I do not think that information is available. The only approach I know
of would be to mimic the logic of the ClassLoader. In other words, you
would need to use the classpath to look at all of the JAR files and
directories, and find all of the class files contained in them.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<MPG.168178dd884c019898adab@forums.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<MPG.168159c4e78ee51a989682@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,4e00fc170de58cf3 X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2001-12-12 11:33:40 PST From: John McGrath [TeamB] <ng-b@JPMcGrath.net> Newsgroups: borland.public.jbuilder.java.api Subject: Re: How to find all Classes in a Package? Date: Wed, 12 Dec 2001 14:23:59 -0500 Message-ID: <MPG.168178dd884c019898adab@forums.borland.com> References: <MPG.168159c4e78ee51a989682@newsgroups.borland.com> X-Newsreader: MicroPlanet Gravity v2.60 NNTP-Posting-Host: 209.92.40.60 X-Trace: dnews 1008185038 209.92.40.60 (12 Dec 2001 11:23:58 -0800) Lines: 19 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews