aspose file tools*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
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
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14347
    
  22

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 8 API documentation
 
 
subject: how to read method_info structure from java file