• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is there a way to know classes in a package via a program  RSS feed

 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure where to post this question but scenario is something like this
I need to know how many classes or objects are in a package and needs to provide a drop down for same in a jsp
When user select any option .It will execute that particular class's test method
I am using JUnit framework but question seem more relevant to something like reflection rather than testing

If any one has gone through this scenario please share your views
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing in the APIs for this. You can try to learn the current classpath, iterate all the folders, jars, zips, etc. in the path and all the classes in each of those. I imagine IDEs like Eclipse must do something like this at startup but the JRE doesn't. Some of the entries in the classpath might be URLs, which won't have an easy way to list their contents.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!