Extracting methods body from a class of Java Source Code

Posted by Muhammad Asaduzzaman on Stack Overflow See other posts from Stack Overflow or by Muhammad Asaduzzaman
Published on 2010-05-06T20:02:18Z Indexed on 2010/05/06 20:08 UTC
Read the original article Hit count: 169

Filed under:
|
|

Hi, I want to extract method body from a Java Source Code. Suppose I have the following code:

public class A{

  public void print(){
    System.out.println("Print This thing");
    System.out.println("Print This thing");
    System.out.println("Print This thing");
  }

}

My objective is not to extract the method name (in this case print) but also the bode of the method(In this case the three print statement inside the print method). Can anyone suggest how can I do so? Is their any library available for doing so.

© Stack Overflow or respective owner

Related posts about java

Related posts about method