PlantUML構文まとめ
個人的にPlantUML構文をまとめる。随時更新予定
ぱっと検索して、記述方法を参照できることを目的とする。
基本構文
一行コメント
複数行コメント(ブロックコメント)
他ファイル読み込み
' ↓は同階層にあるファイルを参照
!include xxx.pu
タイトル
クラス図(Class diagram)
宣言
要素 |
説明 |
abstract |
abstract |
abstract class |
"abstract class" |
annotation |
annotation |
circle |
circle |
() |
circle_short_form |
class |
class |
class |
class_stereo <> |
diamond |
diamond |
<> |
diamond_short_form |
entity |
entity |
enum |
enum |
exception |
exception |
interface |
interface |
metaclass |
metaclass |
protocol |
protocol |
stereotype |
stereotype |
struct |
struct |
可視性の定義
文字 |
可視性 |
- |
private |
# |
protected |
~ |
package private |
+ |
public |
クラス間の関係
記号 |
説明 |
-- |
実践 |
.. |
波線 |
: 関連名 |
関連名をつける |
"1" -- "*" |
多重度 |
<-- |
関連 |
<.. |
依存(Dependency) |
< |
-- |
< |
.. |
*-- |
構成(Composition) |
o-- |
集約(Aggregation) |
+-- |
内部クラス(Inner Class) |
()- |
ロリポップ |
その他
記号 |
説明 |
Package 名前 {} |
パッケージ化 |
namespace 名前 {} |
名前空間(Namespaces) |
note top of クラス名 コメント |
クラスの上にノート |
note bottom of クラス名 コメント |
クラスの下にノート |
note left of クラス名 コメント |
クラスの左にノート |
note right of クラス名 コメント |
クラスの右にノート |
note 表示位置 クラス名::フィールド名 |
フィールドにノート |
note 表示位置 クラス名::メソッド名 |
メソッドにノート |
note 表示位置 on link |
関連にノート |