Javadoc:指定兼容性,直到特定版本?

发布于 2025-01-28 15:51:23 字数 332 浏览 3 评论 0原文

与我可以使用@since标签指定最小兼容Java版本的方式类似,我想在我的Javadoc中指定最大兼容版本(EI表示我的类仅与版本兼容之前, Java 9)。

我已经看过@version用于指定编译器版本的,但是很多Java代码都兼容了许多Java代码,因此我不确定这是否适用于指定界限。我还看到人们使用@deprecated,并说“在Java 9中删除”。我不想贬低课程,因为暂时仅旨在与Java 8一起使用。

显然,我可以在Javadoc评论本身中简单地留言。但是我的好奇心使我变得更好。我可以为此目的使用Javadoc标签吗?

Similarly to how I can specify the minimum compatible Java version using the @since tag, I'd like to specify in my JavaDoc the maximum compatible version (e.i. indicate that my class is only compatible with versions prior to Java 9).

I've seen @version used to specify the compiler version, but a lot of Java code is forwards compatible so I'm not sure if this would work for specifying a bound. I've also seen people use @deprecated with a message saying "removed in Java 9." I don't want to deprecate the class because for the time being it is only intended to be used with Java 8.

Obviously, I can simply leave a note in the JavaDoc comment itself. But my curiosity got the better of me. Is there a JavaDoc tag I can use for this purpose?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文