Question

I am describing some classes using JavaDoc in two steps short description and a developed version of the that description:

/*
 *
 * This class will be used to do things.
 * <p>
 *    Here I am expanding the short description  ...
 * </p>
 * ...
 */
 Class myClass 
 {
     ...
     ...
     ...
 }

I wonder whether is it possible to include listings and enumerations within the detailed description so the result should be something like:

/*
 *
 * This class will be used to do things.
 * <p>
 *    Here I am expanding the short description  ...
 *    * List element 1
 *    * List element 2
 * </p>
 * ...
 */
 Class myClass 
 {
     ...
     ...
     ...
 }

But generating enumerations and/or lists in the HTML output of JavaDoc. Should I use HTML elements such as <ul> and <ol> in the JavaDoc comments?

Was it helpful?

Solution

Yes, HTML elements like

 *  <ul>
 *    <li>Item1</li>
 *    <li>Item2</li>
 *  </ul>

are perfectly OK in javadoc. Have a look at the standard Java API classes for more examples.

OTHER TIPS

I tested my JavaDoc comments and found that HTML tokens are included in the generated documentation:

/**
 * Class intended ....................
 * <p>
 *     Each object ...................
 *     <ul>
 *        <li>Item1</li>
 *        <li>Item2</li>
 *     </ul>
 * </p>
 * @author Pablo.Francisco.Pérez.Hidalgo
 * @since 2013-03-22
 */

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top