indiWiz.com

Subhash's Tech Log

JavaDoc: Avoid Manually Escaping HTML Special Characters

without comments

I discovered this new tip: when writing JavaDoc comments, we do not need to escape HTML characters. The magic happens when we enclose such content inside {@literal ...}. So typically, a comment would look like:

{@literal x < y}

There is another JavaDoc quickie in this line. It is {@code ...}. This is also like {@literal ...}, but displays the code in a different mono-spaced font.

Written by Subhash Chandran

December 14th, 2008 at 5:10 am

Posted in Uncategorized

Tagged with

Leave a Reply