Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / November 2003

Tip: Looking for answers? Try searching our database.

Getting the classes in a package.

Thread view: 
Dave Rudolf - 23 Nov 2003 19:38 GMT
Hi all,

Suppose that I want to see what classes are in a package. The
java.lang.Package class does not have any way to get its classes, but the
java.lang.Class class has its getPackage() method.

So I can imagine some convoluted way of getting the classes in a package by
walking through the VM's class path, and inspecting all jar files, etc. Is
there some simpler way?

Dave.
Michael Amling - 24 Nov 2003 03:54 GMT
> Hi all,
>
[quoted text clipped - 5 lines]
> walking through the VM's class path, and inspecting all jar files, etc. Is
> there some simpler way?

  For ClassLoaders that read directories and jar files, that method has
a chance. In general, though, ClassLoaders could choose arbitrarily what
classes they supply, using unpredictable criteria, so there can never be
a foolproof method of finding classes that haven't been loaded.

--Mike Amling


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.