Java源代码code解析器支持注解 [英] Java source code parser which supports annotations
问题描述
我需要一个Java源代码code解析库的Java编程提取方法定义和说明。
I need a Java source code parsing library for Java to programmatically extract method definitions and annotations.
具体而言,鉴于code,如:
Specifically, given code like :
@WebMethod(operationName = "MyOperation")
public String myOperation(String param1,int param2) { ....
}
我有以下要求:结果
1.提取方法的参数的名称,返回类型和名称和类型搜索
2.提取与方法结果相关联的注释
3.最后,通过删除注释创建一个新的源文件
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
我目前使用JaxMeJS http://ws.apache.org/jaxme/js /jparser.html 它满足1而不是2或3。
I am currently using JaxMeJS http://ws.apache.org/jaxme/js/jparser.html which satisfies 1. but not 2. or 3.
你能不能推荐一个解析库,能够满足所有3个条件?
Could you recommended a parsing library that can fulfill all 3 requirements ?
推荐答案
JavaCC提供了1.5解析器。
JavaCC comes with a 1.5 parser.
这篇关于Java源代码code解析器支持注解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!