Sign in to follow this  

[java] Printing/getting a package's class list

This topic is 4356 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I've been trying to find a way to get a class list from a package. Perhaps just an array containing strings such as: projectname.ui projectname.ui.LaunchPanel projectname.ui.LaunchPanel.AppManager projectname.ui.Login ... ... I can't seem to find a way to do so within Java. Is this possible without using IO to read all of the class files directly? Thanks very much for your time. Any help would be greatly appreciated. -- Alex Broadwin

Share this post


Link to post
Share on other sites
It's a good question.
I searched quickly in the javadoc and on google and i couldn't find anything. There is a Package class but you can't get any Class information from it.
I looked in the source code of the java library (Class, ClassLoader and package). The juicy bits (how is found/loaded a class depending on it's package) is hidden in the native part of java so there is not even a way of using hidden/private methods.

Why do you use it for anyway? There should be another way to do what you want.

Share this post


Link to post
Share on other sites

This topic is 4356 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this