@startuml
class Object
note "In java, every class\nextends this one." as N
Object..N
@enduml
如果想使用更多行且更复杂的备注来支持更多的样式,有下面两种方式。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@startuml
class Object
note top of Object
In java, <size:18>every</size> <u>class</u>
<b>extends</b>
<i>this</i> one.
end note
note as N
In java, <size:18>every</size> <u>class</u>
<b>extends</b>
<i>this</i> one.
end note
Object..N
@enduml
备注除了用于类,还可以用于类的成员和方法:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
@startuml
class A {
{static} int counter
+void {abstract} start(int timeout)
}
note right of A::counter
This member is annotated
end note
note right of A::start
This method is now explained in a UML note
end note
@enduml