• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

introspection of child classes given a package name

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
moderator, can you point me in the right direction on this maybe?

-jason
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic