Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display All packages at a time..

 
Sanju
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
How to disply all packages at a time in console or browser.plz help me
 
Philip Shanks
Ranch Hand
Posts: 189
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "all packages"? Do you mean all of the packages named in a series of import statements?
And, not to make light of your question, why on earth would you want to do that?
PCS
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Open the source file (src.zip) in WinZip or whatever?
I am not sure what you are trying to accomplish.
 
Sanju
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi frineds...
Thank you for your reply...All packages mean All import packages disply at consorl or Browser.How is it?plz help me
 
Philip Shanks
Ranch Hand
Posts: 189
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you can display all of the packages named in the import statements.
Just because you name a class in the import statement, doesn't mean it gets automatically loaded into the virtual machine.
I can't think of any way that the main thread can know what packages are named in the import statements. I think that the default system classloader would have to have access to that information, but an examination of the API reveals no public methods that would allow you to access it.
Nice try... please post if you figure out how to do this (although I don't see much utility in it, it might be a nice academic exercise).
PCS
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Philip Shanks:
I can't think of any way that the main thread can know what packages are named in the import statements. I think that the default system classloader would have to have access to that information, but an examination of the API reveals no public methods that would allow you to access it.

The classloader doesn't have access to that information, because that information isn't part of the class file! Import statements get resolved at compile time - they are just a convenience for programmers, so that you don't have to type fully qualified classnames everywhere.
With other words

will produce identical byte code to
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic