本文介绍了Javadoc是否与<![CDATA [...]]>等效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不幸的是,HTML中没有CDATA。

这太遗憾了,因为它可以完美地添加 javadoc 包含XML的注释,因此您不必转义<和>,例如:

  / **<![CDATA [解析&complexType name => ]]>> * / 

然而, javadoc 来识别CDATA部分,并将其转换为HTML。例如:

 这个解析& lt; complexType name =& gt; 

或者它可以使用比CDATA更简单的语法。由于 javadoc 是可扩展的,因此可能有人添加了此功能;或者可能 javadoc 已经将它埋在里面...有人知道吗?

>

您可以使用JavaDoc的 @code 标记: / **这会分析{@code< complexType name =>} * /


Unfortunately, there is no CDATA in HTML.

This is a pity, because it would be perfect for adding javadoc comments that include XML, so you don't have to escape the < and >, for example:

/**<![CDATA[ This parses <complexType name=""> ]]>*/

However, it would be possible for javadoc to recognize the CDATA section, and convert it to HTML for you. For example:

This parses &lt;complexType name=""&gt;

Or it could use some simpler syntax than CDATA. Because javadoc is extensible, it's possible someone has added this functionality; or maybe javadoc already has it buried somewhere inside... Does anybody know?

解决方案

You can use JavaDoc's @code tag: /** This parses {@code <complexType name="">} */

这篇关于Javadoc是否与&lt;![CDATA [...]]&gt;等效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 17:04