问题
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 <
for < and >
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