In this recipe, you will learn about the usage of HTML5 tags in the Javadoc comments in Java 9.
There are plenty of sources on the Internet that describe HTML5 tags. Since Java 9, one can use any one of them in Javadoc comments.
HTML5 provides better browser compatibility. It is also more mobile-friendly than its predecessor, HTML4. But to take advantage of HTML5, one has to specify the -html5
parameter during Javadoc generation. Otherwise, only HTM4-style comments will continue to be supported.
Here is an example of the HTML5 tags used for Javadoc comments:
/** <h2>Returns the weight of the car.</h2> <article> <h3>If life would be often that easy</h3> <p> Do you include unit of measurement into the method name or not? </p> <p> The new signature demonstrates extensible design of an interface. </p> </article> <aside> <p> A few other examples could be...