Javadoc:package.html或package-info.java [英] Javadoc: package.html or package-info.java
问题描述
在尝试创建包级别的Javadoc注释时,首选方法是什么?你是做什么的?
When trying to create package level Javadoc comments, whats the preferred method? What do you do?
package-info.java
- 优惠
- 较新
- 滥用课程 - 课程用于代码,不仅用于评论
package.html
- 优惠
- HTML扩展意味着它不是代码
- 在IDE /文本编辑器中突出显示语法
- 无?
对我来说,我一直使用Package.html。但我想知道它是否是正确的选择。
For me, I've always used Package.html. But I'm wondering if its the correct choice.
推荐答案
package-info.java
:这个文件是新的JDK 5.0,比package.html更受欢迎。 - javadoc - Java API文档生成器package-info.java
: "This file is new in JDK 5.0, and is preferred over package.html."—javadoc - The Java API Documentation Generator附录:差异似乎是包注释的。在 7.4包声明 。
Addendum: The big difference seems to be package annotations. There's a little more in the way of rationale in 7.4 Package Declarations.
Addendum: The annotation feature is also mentioned here and here.
附录:另见 什么是
package-info.java
for? 。Addendum: See also What’s
package-info.java
for?.这篇关于Javadoc:package.html或package-info.java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!