The UML annotations for a package are stored at the end of their Java Doc in the file package-info.java in the package folder, following the JDK 1.5 specifications. For the first time, if the file package-info.java doesn’t exist, the JavaDoc in the file package.xml will be read if it exists. And afterwards, the new modification will create a file package-info.java.
In general, we can find two kinds of annotations:
@UML.Stereotypes
@UML.Dependencies
It is possible to specify a stereotype for a package. In the following diagram, the package “ gui” has a stereotype “framework”.
This stereotype specification is stored in the file package-info.java in the package “ gui”.
This stereotype specification is stored in the file package-info.java in the package “ gui”:
/** * */ @UML.Stereotypes(@Stereotype("Basic::Framework")) package gui;
In the following example, the package “ gui” has a user-defined dependency of type Realization with the package “ database”.
This dependency is stored in the file package-info.java in the package “ gui”:
/** * */ @UML.Dependencies(@Dependency(value = "database",
stereotypes = @Stereotype("Basic::Responsibility")) package gui;