is the default HTML tag for preformatted text. This is important for Java code containing annotations.Ĭan special characters like the ones above be escaped using HTML number codes like <, > and (which evaluate to '' and the special characters cannot be displayed literally, they should at least be escapable via HTML codes.Is displayed correctly in the rendered should not be evaluated as part of a Javadoc tag but instead be displayed literally. This is especially important for code snippets containing HTML or XML code or Java code containing generics. ''should not be evaluated as part of an HTML tag but instead be displayed literally. To assemble a definitive guide on when to use which of the markup features, I took a look at how theyīehave by answering the following questions for each of them: QuestionĪre indentations and line breaks displayed correctly in the rendered Javadoc?įor multi-line code snippets indentations and line breaks are essential, so they must not get lost when rendering the Javadoc.Īre '' displayed correctly in the rendered Javadoc? Into a Javadoc comment, I’m wondering which of the three to use and what the difference These are the HTML tags and Īnd the Javadoc tag Sounds great, but each time I want to include a code snippet Javadoc supports three different features for code markup. Since there are multiple options to do this - each with different results - this blog post givesĪn overview on these options and a guideline on when to use which. In the final Javadoc HTML, especially when special characters like '' and are involved? But how do you mark the code snippet so that it will be rendered correctly Sometimes you want to add code snippets to our Javadoc comments, especially when developingĪn API of some kind.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |