Search code examples
annotationsplantuml

How to write an annotation with members in PlantUML?


I want to write an annotation with members in PlantUML. Specifically, I want to describe this Java code in PlantUML:

public @interface Foo {
    String bar();
    String baz();
}

I tried to write it in PlantUML, but it causes syntax error:

@startuml
annotation Foo {
    String bar()
    String baz()
}
@enduml

plantuml-syntax-error

However, it's working when I omit the members:

@startuml
annotation Foo
@enduml

enter image description here

What should I do? Thanks.


Solution

  • It's possible to write annotations with members now: http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuKhCoyilIIp9pCzJSClFLwZcKW22u9AYpBnqXQJ48WrDL84ge40jbqDgNWfGCm00

    According to the comment, it's available starting at version V1.2020.2.