我可以在 Javadoc 中对同一个异常使用多个 @throws 标记吗?
如果我的应用程序由于多种原因引发相同的异常,我可以使用多个 @throws
javadoc 标记吗?例如:
@throws UserException if issue 1 happened
@throws UserException if issue 2 happened
@throws UserException if issue 3 happened
JavaDoc标准是否禁止?
Can I use multiple @throws
javadoc tags if my application throws the same exception for multiple reasons? For example:
@throws UserException if issue 1 happened
@throws UserException if issue 2 happened
@throws UserException if issue 3 happened
Is it prohibited by JavaDoc standard?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它在 java 6,7 和 8 中有效。请参阅文档:
(强调我的)
It is valid in java 6,7 and 8. See the docs:
(emph. mine)
刚刚对此进行了测试,生成的 JavaDoc 包含所有 3 个 @throw。
Just tested this the generated JavaDoc contains all 3 @throws.