I need a Java source code parsing library for Java to programmatically extract method definitions and annotations.
Specifically, given code like :
@WebMethod(operationName = "MyOperation")
public String myOperation(String param1,int param2) { ....
}
I have the following requirements:
1. Extract the name, return type and names and types of the method parameters
2. Extract the annotations associated with the method
3. Finally, create a new source file by removing the annotations
I am currently using JaxMeJS http://ws.apache.org/jaxme/js/jparser.html which satisfies 1. but not 2. or 3.
Could you recommended a parsing library that can fulfill all 3 requirements ?