• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to read method_info structure from java file

 
prasad Venkat
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15448
42
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic