To preserve the information between the Javadoc tags that
were generated in previous releases of IBM® Rational® Software Architect,
run the Java-to-UML transformation once to migrate the Javadoc information
into the documentation property of the corresponding element in the
UML model.
Procedure
-
The
next time that you run the
UML-to-Java transformation,
the following events occur:
- For code elements that contain an @generated tag, the UML-Java
transformation replaces the original Javadoc tags with the new Javadoc
tags. The information between the tags is synchronized between the Java code and the UML model.
- For code elements that do not contain an @generated tag, the updates
to the documentation property in the model are not propagated to the Java code.
- . You might edit the code templates to maintain separate
Javadoc information and UML model documentation. To edit the code
templates, click . For each item in the following list, click Edit and,
in the Edit Template window, add the original
Javadoc tags to the code comments:
- Types
- Fields
- Constructors
- Methods
- Getters
- Setters
In the
Code Templates window, after you
edit the code templates, click . The following code fragment
shows an updated Types code template:
/**
* @author $(user)
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* $(tags)
*/
For each code template that you edit, the next
time that you run the
UML-to-Java transformation,
it generates both types of Javadoc tags, as in the following example:
/**
* <!-- begin-UML-doc -->
* Comments between these tags are synchronized between the UML model and generated Java code.
* <!-- end-UML-doc -->
* <!-- begin-user-doc -->
* Comments between these tags appear only in the code.
* <!-- end-user-doc -->
* @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
*/