编写自定义重构脚本的最佳Java库是什么? [英] what is best java libraries to write custom refactoring scripts?

查看:56
本文介绍了编写自定义重构脚本的最佳Java库是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我计划对大型项目进行复杂的重构,默认的ide功能还不够.如果可能,还请提供教程链接.

I plan to do complex refactoring of large project, default ide capabilities is not enough. Please also provide tutorial link if possible.

语言:java,xml

Language: java, xml

我谈论用于Java重构的程序化api

I talk about programmatic api for java refactoring

示例我在项目中创建了新的api,我想自动折射一些代码以使用它,即ast树的源到源转换

Example I have created new api in project and I want automatically refractor some code to use it, ie source to source transformation of ast tree

推荐答案

总是存在 Eclipse ;您应该能够通过其内部过程API访问其Java重构机制.我不知道这些是容易找到还是有据可查的.没有源到源的转换.

There's always Eclipse; you should be able to access its Java refactoring machinery via its internal procedural APIs. Whether those are easily found or well documented, I don't know. No source-to-source transformations.

有一个名为 Jackpot 的工具旨在支持该任务.我相信它也只提供过程API,但我认为它们有据可查.没有源到源转换功能.

There is a tool called Jackpot that was supposedly designed to support this task. I believe it also only offers procedural APIs but I think they are intentionally well documented. No source-to-source transformation capability.

我们的 DMS软件再造工具包及其

Our DMS Software Reengineering Toolkit with its Java Front End could be used for this.

DMS被设计为多种语言的通用程序转换引擎(Java只是碰巧知道的一种).它可以执行任意代码更改.DMS提供对AST的解析,符号表构造,AST操作界面(包括OP对模式导向的源到源转换的请求)以及从任何修改的AST再生源文本(包括原始注释,如果未更改的话).DMS很高兴读取构成您的应用程序的所有文件,因此您可以轻松进行跨越源文件边界的更改.

DMS was designed to be general purpose program transformation engine for many languages (Java is just one it happens to know about). It can carry out arbitrary code changes. DMS provides parsing to ASTs, symbol table construction, an AST manipulation interface, including OP's request for pattern-directed source-to-source transformations, and regeneration of source text (including the original comments if unchanged) from any modified AST. DMS is happy to read all the files that make up your application, so you can effect changes that cross source file boundaries easily.

人们可能建议使用一些解析器生成器.尽管解析是必要的,但这还远远不够.解析器无法完成所需的所有其他操作(上面).

People may suggest using some parser generator. While parsing is necessary, it is hardly sufficient; a parser fails to do all the other things (above) that you need.

这篇关于编写自定义重构脚本的最佳Java库是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆