Adding static imports to a model

About this task

To add static imports to your model:

Procedure

  1. Create a dependency in the browser or by drawing a dependency in an object model diagram. The dependency can be from a class to a class or from a class to an individual static attribute or operation.
  2. Open the Features window for the dependency you created, and apply the StaticImport stereotype to it.

Results

When you next generate code, the code for the dependant class contains the appropriate static import statement.


Feedback