Chapter 10. Using Javadoc

Javadoc Support in NetBeans

All programmers are familliar with code commenting. The Java language supports C-style code commenting (/* and */ for multiline comments and // for single-line comments) plus an additional commenting style called “doc comments.” A doc comment in a Java source file begins with /** (note the double asteriks) and ends with */. These comments are viewed as regular comments by the compiler, but the javadoc tool can be used to parse them and produce an HTML document known as a Javadoc.

Because doc comments are used to produce HTML they can contain HTML markup tags. Typically these are HTML formatting tags such as <B> and <I>. There are also several special non-HTML tags that can be used. For more information on the javadoc tool and the Javadoc tags see The Javadoc Tools Homepage (http://java.sun.com/j2se/javadoc/).

The javadoc tool has been fully integrated into the NetBeans IDE. Developers can search and browse Javadoc libraries (JAR files or folders containing Javadoc HTML files), get context-sensitive Javadocs, add and verify Javadoc tags to their code, and create Javadocs from their source code using the IDE’s Javadoc features.

Mounting Javadocs

Tip

The Javadoc Repository will be removed in NetBeans 3.4.

Before you can search and browse Javadocs, they must be mounted in the Javadoc repository. NetBeans maintains a separate repository for each project you create. The repository contains folders and JAR files that contain Javadocs ...

Get NetBeans: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.