A Java annotation member is mapped directly to the UML Operation owned by the interface stereotyped as «JavaAnnotation». This operation, by itself, can have the stereotype «JavaAnnotationMember». However, it is optional, unless specify a default value for it.

A Java annotation member type is mapped to a UML Type property of a UML Parameter with the “Return“ direction kind.


Annotation member mapping table:

Java ElementUML element
Annotation member declaration

UML Operation with the stereotype «JavaAnnotationMember» (Optional), owned by a UML Interface with the stereotype «JavaAnnotation». 

Annotation member name

UML Operation Name

Annotation member documentation

UML Operation Documentation

Annotation member type

Mapped to the UML Parameter type with the “return“ direction kind (resides in UML Operation parameters list)

Annotation member type modifier

Mapped to the MagicDraw specified property “Type Modifier“

Default value

{JavaAnnotationMemberDefaultValue} tagged value of a «JavaAnnotationMember» stereotype. The stereotype is set on UML Operation

Example

Java source code

/**
* Comment of annotation
*/
public @interface Annotation
{
int id();
String name() default "[unassigned]";
}

UML model