| Author |
how to read method_info structure from java file
|
prasad Venkat
Ranch Hand
Joined: Oct 17, 2006
Posts: 32
|
|
how to read method_info structure of method from java file in java1.4.2 (Each method, including each instance initialization method and the class or interface initialization method , is described by a method_info structure. No two methods in one class file may have the same name and descriptor )
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
You can use Reflection, if you want to find out from the class. Have a look at java.lang.reflect javadocs. Alternatively you can use normal IO to read the java file. (Also - not really an advanced question, so I'm moving it) [ November 13, 2006: Message edited by: Paul Sturrock ]
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12911
|
|
If your goal is to find out if a method is deprecated or not as you asked about in your other topic, then you won't be able to see that using reflection. Like Ulf said there, you'll need to use a class file manipulation library like BCEL or ASM to get this kind of information about a class.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: how to read method_info structure from java file
|
|
|