This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Java in General and the fly likes getting all classes in a prticular packageusing reflection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

getting all classes in a prticular packageusing reflection

satteli kavitha
Greenhorn

Joined: Jul 25, 2008
Posts: 1
I wanted to get all classes in package using reflection can anyone help me for this?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19725
    
  20

As far as I know, this information is not available through the standard API. If you know the physical location to the folder or JAR file (which you might be able to extract from System.getProperty("java.class.path") you could try to look there for the .class files, but that's about as far as you'll get.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Discussed recently
http://www.coderanch.com/t/385824/java/java/All-Classes-Package
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: getting all classes in a prticular packageusing reflection