Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
@throws如果我的应用程序由于多种原因引发相同的异常,我可以使用多个javadoc 标记吗?例如:
@throws
@throws UserException if issue 1 happened @throws UserException if issue 2 happened @throws UserException if issue 3 happened
JavaDoc标准是否禁止它?
它在 java 6,7 和 8 中有效。请参阅文档:
对于相同或不同的异常,可以在给定的文档注释中使用多个 @throws 标签。
(例如我的)
刚刚对此进行了测试,生成的 JavaDoc 包含所有 3 个 @throws。