• Post Reply Bookmark Topic Watch Topic
  • New Topic

introspection of child classes given a package name  RSS feed

 
jason white
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a strange problem that I don't know how to solve:

Given a package name: "com.foo" find all objects within that package.

I have looking in javax.naming, Class, ClassLoader...not sure where to go...

I feel like there is probably a simple answer but no one seems to know it...

-jason
scea, scwcd, scbcd, scjp, mcp
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I don't think there's any simple way to do that.
 
jason white
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
moderator, can you point me in the right direction on this maybe?

-jason
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can take the classpath, iterate through all the directories in it and see what you find. All zip and jar file files in it need to be opened and inspected as well. Like Peter says, there is no ready-made API for this.
[ March 24, 2006: Message edited by: Ulf Dittmer ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!