How to create multiple levels of indentation in Javadoc?

James Raitsev picture James Raitsev · Jun 25, 2011 · Viewed 55.4k times · Source

Suppose, that as part of documenting your code (Javadoc) you want to indicate that the relationships between elements using deep indentation.

How can I create a nested list as:

  • some element
    • some other element
      • yet some other element

Answer

Charlie Martin picture Charlie Martin · Jun 25, 2011
<ul>
  <li>Element</li>
  <ul>
     <li>Subelement...</li>

You can pretty freely use HTML inside javadoc comments.

Update: Because it came up, I tried

<ul>
    <li>one</li>
    <ul>
        <li>one point one</li>
    </ul>   
</ul>

and get

  • one
    • one point one

I agree proper nesting is better.