Adding Javadoc tags

The Javadoc generation mechanism allows you to define new Javadoc tags that you would like to use.

About this task

To define a Javadoc tag:

Procedure

  1. Create a writable copy of the JavaDocProfile profile by selecting File > Add to Model, and then selecting the file <Rhapsody installation path>\Share\
    Profiles\JavaDoc\JavaDocProfile.sbs
    (When the product indicates that the profile exists in the model, select the Replace Existing Unit option.)
  2. Create a Javadoc tag in your profile. When you create the tag, select the appropriate item from the Applicable To list.
  3. Modify the value of the DescriptionTemplate property for the relevant type of element. Use $<tagname> to have the product include the tag text in the Javadoc comment.
  4. Open the Features window for specific elements of the relevant type, and on the Tags tab provide a value for the new Javadoc tag you have added.

Example

Procedure

  1. Create under your profile a new tag called codeReviewer. From the Applicable to list, select Class.
  2. For the JAVA_CG::Class::DescriptionTemplate property, add the following to the property value: [[ * @codeReviewer $codeReviewer]]
  3. For one or more of the classes in your model, open the Features window, and on the Tags tab, enter Steve for the value of the tag codeReviewer.

Results

When you generate code for your model after these changes, the Javadoc comments for these classes include @codeReviewer Steve.