你如何逃避javadoc中的@字符? [英] How can you escape the @ character in javadoc?

查看:107
本文介绍了你如何逃避javadoc中的@字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何避免javadoc中的 @ 符号?我试图在 {@ code} 标签内使用它,这个标签位于< pre> 标签之内。 / p>

我已经尝试过html转义&#64; 序列,但没有起作用。 >

解决方案

使用 {@ literal} javadoc标签:

  / ** 
*这是一个at符号:{@literal @}
* /
/ pre>

这个javadoc将显示为:

 这是一个at符号:@ 

当然,这将适用于任何字符,是显示任何特殊字符的官方支持方式。



它也是最直接的 - 你不需要知道十六进制角色的代码可以读取您输入的内容!


How can I escape the @ symbol in javadoc? I am trying to use it inside a {@code} tag, which is inside <pre> tags.

I already tried the html escape &#64; sequence, but that didn't work.

解决方案

Use the {@literal} javadoc tag:

/**
 * This is an "at" symbol: {@literal @}
 */

The javadoc for this will read:

This is an "at" symbol: @

Of course, this will work for any characters, and is the "officially supported" way of displaying any "special" characters.

It is also the most straighforward - you don't need to know the hex code of the character, and you can read what you've typed!

这篇关于你如何逃避javadoc中的@字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆