This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes how to read method_info structure from java  file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "how to read method_info structure from java  file" Watch "how to read method_info structure from java  file" New topic
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
    
    3

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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to read method_info structure from java file
 
Similar Threads
String Literals and Garbage Collection.
What is a synthetic field ?
Is there any important difference in 1.3 and 1.4 Deployment Description ?
Convert bytes into primitive types
IllegalMonitorStateException - Different in J2ME?