I think so.  There are basically two ways of doing this (that I can think
of).

(1) Creating a listing of *every* class in *every* path of your CLASSPATH.
That includes searching inside jar files and zip files.  Then, if you
understand Java bytecode, you can decode the package name of for each class
file in the list (or use javap to do it for you).

(2)  If you can create JavaDocs for every class, just get the classes for a
package by parsing the javadocs.  The JDK 1.2 javadoc tool makes this very
easy because it will generate a directory for each package and put the
javadocs for every class of a package into the package directory.

Using (1) you should be able to get non-public classes too, but off-hand, I
don't remember whether javadoc will produce javadocs for non-public classes.

David



----- Original Message -----
From: Radhakrishnan, Sanjay (c) <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 29, 1999 1:32 PM
Subject: Off topic: Classes in a package?


> I am writing a utility program in java which should do the following.
Given
> a package name it should display all classes in that package. Is there a
way
> by which i can do that in java?
>
> Thanks for your time
> Sanjay
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to