既然我们在 Java 中有注释,那么 xdoclet 是遗留的吗? [英] Now that we have annotations in java, is xdoclet legacy?

查看:23
本文介绍了既然我们在 Java 中有注释,那么 xdoclet 是遗留的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我接触了 xdoclet 项目,看到它享有很高的人气.所以问题是,现在我们在 java 中有注释:xdoclet 是遗留的吗?

I came accross the xdoclet project and see it enjoys/ed high popularity. So the question is, now that we have annotations in java: is xdoclet legacy?

或者 xdoclet 有什么我没有看到/理解的东西.

Or is there something to xdoclet I didn't see/understand.

推荐答案

XDoclet 是通过 JavaDoc 实现的注解.任何可以用 XDoclet(以及更多)完成的事情都可以用 JDK5+ 注释来完成.

XDoclet is an annotation implementation via JavaDoc. Anything that could be done with XDoclet (and much more) can be done with JDK5+ annotations.

然而,一个明显的区别是 XDoclet非侵入性的.也就是说,它不需要您将类导入到您自己的代码中.如果您在自己的代码中使用 3rd-party Java 注释,那么如果没有 3rd 方 jars,您当然无法构建您的代码.这不是 XDoclet 遭受的缺点.(你可能根本不认为这是一个缺点.)

One obvious difference however is that XDoclet is non-invasive. That is, it doesn't require you to import classes into your own code. If you are using 3rd-party Java annotations in your own code, then of course you cannot build your code without the 3rd party jars present. This is not a drawback that XDoclet suffers from. (You may not see it as a drawback at all.)

当然,即使 XDoclet 可能是遗留的,我怀疑对于大多数严重依赖它的项目,不会急于迁移到使用注释(格言:如果它是坏了,不要修理它).

Of course, even though XDoclet may be legacy, I suspect that for most projects which have relied heavily on it, there will be no rush to migrate to using annotations (maxim: if it ain't broke, don't fix it).

这篇关于既然我们在 Java 中有注释,那么 xdoclet 是遗留的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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