Javadoc @throws markers

 

Customizing Javadoc documentation

Javadoc @throws markers are used in the generation of Java documentation for exceptions that have Javadoc notes. 

 

If you want the information contained in Javadoc notes on exceptions to appear in the generated Java documentation, you must specify this when configuring Objecteering Java Developer parameters (as shown in Figure 82 below).

 

Figure 82. Parameterizing generation of Javadoc notes on exceptions in Java documentation

 

Steps:

1.      Select the "Documentation" set of Java module parameters.

2.      Check the "Generate Javadoc notes for "throws" statements" tickbox.

 

Javadoc notes entered for thrown exceptions will now be generated in Java documentation.

 

 

Entering Javadoc notes on exceptions

To enter Javadoc notes on exceptions, the "Notes" tab of the thrown exception's dialog box is used (as shown in Figure 83).

 

Figure 83. Entering a Javadoc note for a thrown exception

 

Steps:

1.      After opening the thrown exception's dialog by double-clicking, click on the "Notes" tab.

2.      Click on the "Add" button to create a new note.

3.      Select the "Javadoc" type of note.

4.      Enter the contents of the Javadoc note.

5.      Confirm by clicking on "OK".

 

 

The result of the operations shown in Figures 82 and 83 is shown in Figure 84 below.

 

Figure 84. Extracts from generated Javadoc documentation and the generated source file

 

The information you entered in the Javadoc note is presented in the generated Java documentation.  It is introduced by the "Throws" title, followed first by the elements involved in the thrown exception and then by its description.

 

The same information is present in the generated source file, preceded by the @throws marker.