Putting sample XML code in Javadoc

北城以北 提交于 2020-01-24 05:45:06

问题


How to put a sample XML code in Javadoc? The XML code includes angle brackets which I do not want to be processed.

I tried combinations of PRE and code but it didn't work.


回答1:


You can use @code javadoc tag. Take a look to this post, wich contains some examples. Hope it helps




回答2:


You have to use HTML/XML encoding like &lt; for < and &gt; for >.

If you use Eclipse, there is a Javadoc view that shows you a preview.



来源:https://stackoverflow.com/questions/26588234/putting-sample-xml-code-in-javadoc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!