如何写“@”在javadoc中?

发布于 2024-12-20 09:20:13 字数 335 浏览 1 评论 0原文

我的 javadoc 代码示例中有一个 @

 * <pre>
 * public class ArticleService<Article, ArticleDao> {
 *     @Autowired
 *     private ArticleDao articleDao;
 *     protected ArticleDao getDao() { return articleDao; }
 * }
 * </pre>

它破坏了 javadoc,因为预览看起来像:

如何解决?

There is a @ in my code example in javadoc:

 * <pre>
 * public class ArticleService<Article, ArticleDao> {
 *     @Autowired
 *     private ArticleDao articleDao;
 *     protected ArticleDao getDao() { return articleDao; }
 * }
 * </pre>

It breaks the javadoc, because the preview looks like:

enter image description here

How to fix it?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

聽兲甴掵 2024-12-27 09:20:13

使用 { @literal} 标签:

 * <pre>
 *     {@literal @Autowired}
 *     private ArticleDao articleDao;
 * 
 *     protected ArticleDao getDao()
 *     {
 *         return articleDao;
 *     }
 * </pre>

我刚刚测试了这个以确保它有效......并且它确实有效

Use the {@literal} tag:

 * <pre>
 *     {@literal @Autowired}
 *     private ArticleDao articleDao;
 * 
 *     protected ArticleDao getDao()
 *     {
 *         return articleDao;
 *     }
 * </pre>

I have just tested this to make sure it works... and it does

无所的.畏惧 2024-12-27 09:20:13

只需将 @ 替换为 @

Simply replace @ with @:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文