Wrap Up - javadoc DocumentationJ8 Home « Wrap Up - javadoc Documentation

In our penultimate lesson of the case study we create documentation for the case study by running the javadoc tool on the packages we have coded. This will extract the HTML style comments we have written in the source files and produce a top level folder and subfolders for the packages.

The javadoc Tool Top

The javadoc tool comes with a lot of options as you can see from the following screenshot. You can explore the various options at your leisure but we will just be using the -d option to create our documentation.

javadoc Options
Screenshot 1. javadoc Options.

Running javadoc Top

As our code is separated into different packages we can create javadocs at the package level.

Change to directory  cd D:\ManufacturerApplication\src or wherever your source code for the ManufacturerApplication project is.

Run the javadoc tool using the -d option   javadoc -d ..\javadoc client model remoteservices services

The following screenshot shows the results of running the javadoc tool on our source packages and the files and directories created.

Run javadoc
Screenshot 2. Running javadoc.

This screenshot shows the files and directories created in the javadoc folder.

javadoc Directory
Screenshot 3. javadoc files and directories.

Exploring Our API DocumentationTop

Change to directory   cd D:\ManufacturerApplication\javadoc   or wherever you generated the javadoc for the ManufacturerApplication project.

The following screenshot is after typing   index.html from the command prompt and the resultant HTML displayed in Chrome on my Windows 10 machine. The documentation produced should be familiar in style as it matches that produced for the offical API documentation. Although using javadoc has an initial effort by the end of the project we have a documented API for others to use in the future. Well worth the effort and a good practice to get into.

Looking at javadoc
Screenshot 4. javadoc documentation.

What's Next?

We wrap up the Java case study and our code!