Re: Using Reflection to get all Classes?
- From: "John C. Bollinger" <jobollin@xxxxxxxxxxx>
- Date: Fri, 29 Apr 2005 12:10:36 -0500
Tor Iver Wilhelmsen wrote:
julianwissel@xxxxxx (Julian) writes:
But I would like to create a Class Browser that shows all classes that are available in the system. Is this possible? If it is, how?
You need to navigate System.getProperty("java.class.path") and the bootclasspath. Look in every jar, directory etc. - recursively - and analyze .class files. Remember to "convert" nested classes (they have a $ in their names).
And you must recognize that the classes you discover this way are not the only ones that an application running on the system might be able to load. An application may include any number of its own classes or external libraries that come from locations not on the default classpath. You might not find all these even if you were to run your class browser from within the application in question. You certainly will never find classes that an application might load over a network, or from a database, or those that an application might synthesize at runtime.
In general, it is impossible to find "all classes available in the system", but if you narrow the scope (to classes available via the class browser's own classpath, for instance) then you can achieve the goal.
-- John Bollinger jobollin@xxxxxxxxxxx .
- References:
- Using Reflection to get all Classes?
- From: Julian
- Re: Using Reflection to get all Classes?
- From: Tor Iver Wilhelmsen
- Using Reflection to get all Classes?
- Prev by Date: Re: Using Reflection to get all Classes?
- Next by Date: java assembler?? for Javap utility??
- Previous by thread: Re: Using Reflection to get all Classes?
- Next by thread: Re: Using Reflection to get all Classes?
- Index(es):
Relevant Pages
|