Skip to main content
GameDev.net gamedev.net
🔒 Locked

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

Started by PixolMaster Jan 9, 2006 at 1:40 PM 0 replies 800+ views
Original Post
PixolMaster
PixolMaster
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
Monkeyget
Monkeyget
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.