aspose file tools*
The moose likes Java in General and the fly likes How to display All packages at a time.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to display All packages at a time.." Watch "How to display All packages at a time.." New topic
Author

How to display All packages at a time..

Sanju
Ranch Hand

Joined: Jul 15, 2002
Posts: 53
hi ,
How to disply all packages at a time in console or browser.plz help me


Thank you,<br />Sanju
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
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


Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Open the source file (src.zip) in WinZip or whatever?
I am not sure what you are trying to accomplish.
Sanju
Ranch Hand

Joined: Jul 15, 2002
Posts: 53
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

Joined: Oct 15, 2002
Posts: 189
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

Joined: Jul 11, 2001
Posts: 14112
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


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to display All packages at a time..