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:
We can use the @see and @link tag multiple times in a class, package, or method. The @see tag declares references that point to an external link, class, or method. The @link tag can also be used multiple times for declaring inline links or in contrast with other block tags.
Use the standard style for the Javadoc commentJavadoc only requires a '/**' at the start and a '*/' at the end. In addition to this, use a single star on each additional line: /** * Standard comment. */ public ... /** Compressed comment.
Javadoc provides the @link inline tag for referencing the members in the Java classes. We can think of the @link tag as similar to the anchor tag in HTML, which is used to link one page to another via hyperlinks. Similar to the anchor tag, the path_to_member is the destination, and the label is the display text.
<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
I agree proper nesting is better.
The correct way is as follows:
/** * <ul> * <li>some element * <li><ul> * <li>some other element * <li><ul> * <li>yet some other element * </ul> * </ul> * </ul> */
Although JavaDoc borrows from HTML, it isn't HTML, and you should omit the </li>
tags, just as you should omit </p>
tags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With