开发者

Where in the NetBeans 6.9.1 source code is the code for scanning Java files and finding all the methods, variables, imports etc

开发者 https://www.devze.com 2023-02-06 17:11 出处:网络
I\'m looking for a sample or possibly even code I can use which scans Java files and tells me key pieces of information about each class, which i can then use mu开发者_StackOverflow中文版ch like the N

I'm looking for a sample or possibly even code I can use which scans Java files and tells me key pieces of information about each class, which i can then use mu开发者_StackOverflow中文版ch like the NetBeans refactoring and go to source features do.


Instead of reusing the Netbeans sources, you should probably just find a good library.

tells me key pieces of information about each class

Depending on your definition of "key pieces", I would recommend QDox:

http://qdox.codehaus.org/

QDox is a high speed, small footprint parser for extracting class/interface/method definitions from source files complete with JavaDoc @tags.


If you are looking for reusing Netbeans code which parses Java file, I don't know.

If you are looking for how to parse a Java file, you can try ANTLR. ANTLR is a parser generator. There exists Java grammar which you can use right away. Once, you generate a Java parser, you can use the parser to parse your Java file. You will have to learn how to use ANTLR.


I don't understand very well your question.

If you want to navigate inside source java code with netbeans, push CTRL and with your mouse go over the word you want to explore ; netbeans highligth the word, and if you clic you go to the source.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号