Static import constructs

The static import constructs, introduced in J2SE 5.0, allow unqualified access to static members of a class. IBM® Rational® Rhapsody® models static imports and generates appropriate code. In addition, the reverse engineering feature can handle static imports in Java code, and the roundtripping feature can handle changes to static import statements.

Rational Rhapsody allows you to model both static import of individual class members (import static java.lang.Math.PI) and static import of all static members of a class (import static java.lang.Math.*).

Modeling of static imports is based on use of the StaticImport stereotype in the PredefinedTypesJava package. The StaticImport stereotype inherits from the Usage stereotype.


Feedback