Generating getter and setter methods with the UML-to-Java transformation

You can specify that the UML-to-Java transformation generate a field with getter and setter methods for each UML property. If the isLeaf (final) or isReadOnly are set to true, no setter is generated. If the isDerived property is set to true, the setter implementation is empty.

Before you apply the UML-to-Java transformation, you should read the information that is available at Modeling > Transform > Configure Transformations. From the Transformations/Configurations list, select UML to Java. On the Transformation Description page, click View Transformation Documentation.

You must be in the Modeling perspective.

To generate getter and setter methods for Java™ classes that the UML-to-Java transformation generates:
  1. Click Modeling > Transform > Configure Transformations.
  2. In the Configure Transformations window, from the Transformations/Configurations list, select a transformation configuration.
  3. Click the Properties tab.
  4. On the Properties page, select the Generate getters and setters check box.
  5. Click Apply.
  6. Click Close.
Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.