尝试转义"@" Netbeans 8.0在Javadoc注释中的{@code}块中的符号 [英] Trying to escape the "@" symbol in a {@code} block within a javadoc comment with Netbeans 8.0
问题描述
我正在尝试使用Netbeans 8.0在Javadoc注释中插入{@code}批注,但无法正常工作.
I'm trying to insert a {@code } annotation in a Javadoc comment using Netbeans 8.0 and it's not working properly.
我以前已经看过其他问题(例如,如何在Javadoc中转义@字符?),但是html转义@
和{@literal @}
似乎都无效.
I've seen other questions on this from before (i.e., How can you escape the @ character in javadoc?) but the html escape @
and {@literal @}
both don't seem to work.
我的评论看起来像这样(为了示例,同时使用两种方法):
My comment looks like this (using both methods for sake of the example):
/**
* blah blah blah
* <p>
* For example:
* <pre>
* {@code
* {@literal @}begin_specification
* ...
* @end_specification
* }
* </pre>
*/
我可以按Run -> Generate Javadoc
,并且一切运行正常,没有任何错误,但是当我在浏览器中查看结果输出时,我看到了这一点:
I can hit Run -> Generate Javadoc
and everything runs fine with no errors but I see this when I look at the resulting output in a browser:
{@literal @}begin_specification
...
@end_specification
哪个不是理想的结果?有什么建议/想法吗?
Which isn't the desired result... Any suggestions/ideas?
我对Java还是很陌生,但过去曾在C/C ++中使用过Doxygen之类的东西.我在这里做错什么了吗?我正在将NetBeans 8.0(内部版本201403101706)与Java 1.8.0_05 x64结合使用.
I'm fairly new to Java but have used things like Doxygen in C/C++ in the past. Am I doing something wrong here? I'm using NetBeans 8.0 (Build 201403101706) with Java 1.8.0_05 x64.
推荐答案
一种方法是使用:
<pre> <code>
{@literal @}
</code> </pre>
代替{@code ...}
块.参见此示例第86行.
instead of an {@code ...}
block. See this example around line 86.
这篇关于尝试转义"@" Netbeans 8.0在Javadoc注释中的{@code}块中的符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!