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