You can annotate Java elements. This annotation is mapped on top of the {JavaAnnotations} tagged value of the stereotype «JavaElement». «JavaElement» is a base stereotype for all stereotypes used in Java mapping, and can be used directly or with any other stereotype derived from it. Annotation is mapped as a simple string value.

Example

Java source code

public class Test
{
@Annotation
(
id = 2,
name = "Rick"
)
public void foo(){}
}

UML Model

Java annotation usage