Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Classes in a package

Status
Not open for further replies.

jdjuanci

Programmer
Jun 30, 2001
4
ES
I know how to retrieve methods from a class
Method[] mt=forName("ClassName").getMethods();
and get Packages installed.

Now, I need to get all classes in a Package.

Is it possible?

Thanks
 
the ClassLoader may help, but methods such as getPackages are protected and you would probably have to extend it to make these available. However, I don't see anything like package.getClasses(); anywhere.

You could maybe write something that looks for the Files themselves... Jeremy Nicholson, Director of a UK-based Java and Data Warehousing consultancy
 
Building on what jnicho02 said, i think the only way to do what you what is to get all the declared classes and then check each one with getPackage().
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top