您的位置:首页 > 编程语言 > Java开发

Display XML in a javadoc

2014-08-02 09:08 197 查看
Let's say you have a comment like this

/**
* To use this class use this XML
*
* <xml>
*   <parameter>foo</parameter>
*   <value>bar</value>
* </xml>
*
*/


The XML will not be visible since it will embedded in the HTML as tag and not as text.
With Javadoc 1.5, you can use the {@code ... } command. :

/**
* To use this class use this XML
* <pre>
* {@code
* <xml>
*   <parameter>foo</parameter>
*   <value>bar</value>
* </xml>
* }
* </pre>
*/


With the previous versions, one way was to add a space after the <.

/**
* To use this class use this XML
* <pre>
* < xml>
*   < parameter>foo< /parameter>
*   < value>bar< /value>
* < /xml>
* }
* </pre>
*/

http://www.rgagnon.com/javadetails/java-0623.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐