Does Javadoc have an equivalent to <![CDATA[ … ]]>?

后端 未结 4 860
心在旅途
心在旅途 2020-12-15 04:10

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 t

4条回答
  •  佛祖请我去吃肉
    2020-12-15 04:37

    Extending @Fabian's answer, I use both

     and {@code ...}. Here an example with XML as source code:

    /*Outputs data from a result set to an XML
     * with following structure:
     * 
     * {@code
     * 
     *  gregh
     *  487
     *  
     * 
     * 
     * }
     * 
    */

     allows you to write code on multiple lines and preserve its structure.

    Tested with Eclipse 3.6.1.

提交回复
热议问题