Is it possible to get a list of all classes referenced in a class?. I can get all class variables using getDeclaredClasses() method in Class object, but how do i get the classes of local variable used inside a method ? Can anyone help? Thanks in advance. Rahul
Stan James
(instanceof Sidekick)
Ranch Hand
Joined: Jan 29, 2003
Posts: 8791
posted
0
I'm not sure if there are APIs from the Class object, but the format of the class file is well documented and not too hard to parse. Some of the tools that seek out all references for dependency mapping just read the class files that way. A quick Google for "java class file format" got THIS. See if that approach is at all promising.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi