Debian Codegraph @

tests/languages/mermaid/full_classdiagram.test

raw
1 classDiagram
2 Animal <|-- Duck
3 Animal <|-- Fish
4 Animal <|-- Zebra
5 Animal : +int age
6 Animal : +String gender
7 Animal: +isMammal()
8 Animal: +mate()
9 class Duck{
10 +String beakColor
11 +swim()
12 +quack()
13 }
14 class Fish{
15 -int sizeInFeet
16 -canEat()
17 }
18 class Zebra{
19 +bool is_wild
20 +run()
21 }
22
23 classDiagram
24 class BankAccount
25 BankAccount : +String owner
26 BankAccount : +Bigdecimal balance
27 BankAccount : +deposit(amount)
28 BankAccount : +withdrawl(amount)
29
30 classDiagram
31 class Animal
32 Vehicle <|-- Car
33
34 class BankAccount
35 BankAccount : +String owner
36 BankAccount : +BigDecimal balance
37 BankAccount : +deposit(amount)
38 BankAccount : +withdrawal(amount)
39
40 class BankAccount{
41 +String owner
42 +BigDecimal balance
43 +deposit(amount)
44 +withdrawl(amount)
45 }
46
47 class BankAccount{
48 +String owner
49 +BigDecimal balance
50 +deposit(amount) bool
51 +withdrawl(amount) int
52 }
53
54 classDiagram
55 class Square~Shape~{
56 int id
57 List~int~ position
58 setPoints(List~int~ points)
59 getPoints() List~int~
60 }
61
62 Square : -List~string~ messages
63 Square : +setMessages(List~string~ messages)
64 Square : +getMessages() List~string~
65
66 classDiagram
67 classA <|-- classB
68 classC *-- classD
69 classE o-- classF
70 classG <-- classH
71 classI -- classJ
72 classK <.. classL
73 classM <|.. classN
74 classO .. classP
75
76 classDiagram
77 classA --|> classB : Inheritance
78 classC --* classD : Composition
79 classE --o classF : Aggregation
80 classG --> classH : Association
81 classI -- classJ : Link(Solid)
82 classK ..> classL : Dependency
83 classM ..|> classN : Realization
84 classO .. classP : Link(Dashed)
85
86 classDiagram
87 classA <|-- classB : implements
88 classC *-- classD : composition
89 classE o-- classF : association
90
91 classDiagram
92 Customer "1" --> "*" Ticket
93 Student "1" --> "1..*" Course
94 Galaxy --> "many" Star : Contains
95
96 classDiagram
97 class Shape
98 <<interface>> Shape
99
100 classDiagram
101 class Shape{
102 <<interface>>
103 noOfVertices
104 draw()
105 }
106 class Color{
107 <<enumeration>>
108 RED
109 BLUE
110 GREEN
111 WHITE
112 BLACK
113 }
114
115 classDiagram
116 %% This whole line is a comment classDiagram class Shape <<interface>>
117 class Shape{
118 <<interface>>
119 noOfVertices
120 draw()
121 }
122
123 classDiagram
124 direction RL
125 class Student {
126 -idCard : IdCard
127 }
128 class IdCard{
129 -id : int
130 -name : string
131 }
132 class Bike{
133 -id : int
134 -name : string
135 }
136 Student "1" --o "1" IdCard : carries
137 Student "1" --o "1" Bike : rides
138
139 action className "reference" "tooltip"
140 click className call callback() "tooltip"
141 click className href "url" "tooltip"
142
143 classDiagram
144 class Shape
145 link Shape "http://www.github.com" "This is a tooltip for a link"
146 class Shape2
147 click Shape2 href "http://www.github.com" "This is a tooltip for a link"
148
149 classDiagram
150 class Shape
151 callback Shape "callbackFunction" "This is a tooltip for a callback"
152 class Shape2
153 click Shape2 call callbackFunction() "This is a tooltip for a callback"
154
155 classDiagram
156 Animal <|-- Duck
157 Animal <|-- Fish
158 Animal <|-- Zebra
159 Animal : +int age
160 Animal : +String gender
161 Animal: +isMammal()
162 Animal: +mate()
163 class Duck{
164 +String beakColor
165 +swim()
166 +quack()
167 }
168 class Fish{
169 -int sizeInFeet
170 -canEat()
171 }
172 class Zebra{
173 +bool is_wild
174 +run()
175 }
176
177 callback Duck callback "Tooltip"
178 link Zebra "http://www.github.com" "This is a link"
179
180 classDiagram
181 class Animal:::cssClass
182
183 classDiagram
184 class Animal:::cssClass {
185 -int sizeInFeet
186 -canEat()
187 }
188
189 ----------------------------------------------------
190
191 [
192 ["keyword", "classDiagram"],
193
194 "\r\n Animal ",
195 ["arrow", "<|--"],
196 " Duck\r\n Animal ",
197 ["arrow", "<|--"],
198 " Fish\r\n Animal ",
199 ["arrow", "<|--"],
200 " Zebra\r\n Animal ",
201 ["operator", ":"],
202 " +int age\r\n Animal ",
203 ["operator", ":"],
204 " +String gender\r\n Animal",
205 ["operator", ":"],
206 " +isMammal",
207 ["punctuation", "("],
208 ["punctuation", ")"],
209
210 "\r\n Animal",
211 ["operator", ":"],
212 " +mate",
213 ["punctuation", "("],
214 ["punctuation", ")"],
215
216 ["keyword", "class"],
217 " Duck",
218 ["punctuation", "{"],
219
220 "\r\n +String beakColor\r\n +swim",
221 ["punctuation", "("],
222 ["punctuation", ")"],
223
224 "\r\n +quack",
225 ["punctuation", "("],
226 ["punctuation", ")"],
227
228 ["punctuation", "}"],
229
230 ["keyword", "class"],
231 " Fish",
232 ["punctuation", "{"],
233
234 "\r\n -int sizeInFeet\r\n -canEat",
235 ["punctuation", "("],
236 ["punctuation", ")"],
237
238 ["punctuation", "}"],
239
240 ["keyword", "class"],
241 " Zebra",
242 ["punctuation", "{"],
243
244 "\r\n +bool is_wild\r\n +run",
245 ["punctuation", "("],
246 ["punctuation", ")"],
247
248 ["punctuation", "}"],
249
250 ["keyword", "classDiagram"],
251
252 ["keyword", "class"],
253 " BankAccount\r\n BankAccount ",
254 ["operator", ":"],
255 " +String owner\r\n BankAccount ",
256 ["operator", ":"],
257 " +Bigdecimal balance\r\n BankAccount ",
258 ["operator", ":"],
259 " +deposit",
260 ["text", "(amount)"],
261
262 "\r\n BankAccount ",
263 ["operator", ":"],
264 " +withdrawl",
265 ["text", "(amount)"],
266
267 ["keyword", "classDiagram"],
268
269 ["keyword", "class"],
270 " Animal\r\n Vehicle ",
271 ["arrow", "<|--"],
272 " Car\r\n\r\n",
273
274 ["keyword", "class"],
275 " BankAccount\r\n BankAccount ",
276 ["operator", ":"],
277 " +String owner\r\n BankAccount ",
278 ["operator", ":"],
279 " +BigDecimal balance\r\n BankAccount ",
280 ["operator", ":"],
281 " +deposit",
282 ["text", "(amount)"],
283
284 "\r\n BankAccount ",
285 ["operator", ":"],
286 " +withdrawal",
287 ["text", "(amount)"],
288
289 ["keyword", "class"],
290 " BankAccount",
291 ["punctuation", "{"],
292
293 "\r\n +String owner\r\n +BigDecimal balance\r\n +deposit",
294 ["text", "(amount)"],
295
296 "\r\n +withdrawl",
297 ["text", "(amount)"],
298
299 ["punctuation", "}"],
300
301 ["keyword", "class"],
302 " BankAccount",
303 ["punctuation", "{"],
304
305 "\r\n +String owner\r\n +BigDecimal balance\r\n +deposit",
306 ["text", "(amount)"],
307 " bool\r\n +withdrawl",
308 ["text", "(amount)"],
309 " int\r\n",
310
311 ["punctuation", "}"],
312
313 ["keyword", "classDiagram"],
314
315 ["keyword", "class"],
316 " Square~Shape~",
317 ["punctuation", "{"],
318
319 "\r\n int id\r\n List~int~ position\r\n setPoints",
320 ["text", "(List~int~ points)"],
321
322 "\r\n getPoints",
323 ["punctuation", "("],
324 ["punctuation", ")"],
325 " List~int~\r\n",
326
327 ["punctuation", "}"],
328
329 "\r\n\r\nSquare ",
330 ["operator", ":"],
331 " -List~string~ messages\r\nSquare ",
332 ["operator", ":"],
333 " +setMessages",
334 ["text", "(List~string~ messages)"],
335
336 "\r\nSquare ",
337 ["operator", ":"],
338 " +getMessages",
339 ["punctuation", "("],
340 ["punctuation", ")"],
341 " List~string~\r\n\r\n",
342
343 ["keyword", "classDiagram"],
344
345 "\r\nclassA ",
346 ["arrow", "<|--"],
347 " classB\r\nclassC ",
348 ["arrow", "*--"],
349 " classD\r\nclassE ",
350 ["arrow", "o--"],
351 " classF\r\nclassG ",
352 ["arrow", "<--"],
353 " classH\r\nclassI ",
354 ["arrow", "--"],
355 " classJ\r\nclassK ",
356 ["arrow", "<.."],
357 " classL\r\nclassM ",
358 ["arrow", "<|.."],
359 " classN\r\nclassO ",
360 ["arrow", ".."],
361 " classP\r\n\r\n",
362
363 ["keyword", "classDiagram"],
364
365 "\r\nclassA ",
366 ["arrow", "--|>"],
367 " classB ",
368 ["operator", ":"],
369 " Inheritance\r\nclassC ",
370 ["arrow", "--*"],
371 " classD ",
372 ["operator", ":"],
373 " Composition\r\nclassE ",
374 ["arrow", "--o"],
375 " classF ",
376 ["operator", ":"],
377 " Aggregation\r\nclassG ",
378 ["arrow", "-->"],
379 " classH ",
380 ["operator", ":"],
381 " Association\r\nclassI ",
382 ["arrow", "--"],
383 " classJ ",
384 ["operator", ":"],
385 " Link",
386 ["text", "(Solid)"],
387
388 "\r\nclassK ",
389 ["arrow", "..>"],
390 " classL ",
391 ["operator", ":"],
392 " Dependency\r\nclassM ",
393 ["arrow", "..|>"],
394 " classN ",
395 ["operator", ":"],
396 " Realization\r\nclassO ",
397 ["arrow", ".."],
398 " classP ",
399 ["operator", ":"],
400 " Link",
401 ["text", "(Dashed)"],
402
403 ["keyword", "classDiagram"],
404
405 "\r\nclassA ",
406 ["arrow", "<|--"],
407 " classB ",
408 ["operator", ":"],
409 " implements\r\nclassC ",
410 ["arrow", "*--"],
411 " classD ",
412 ["operator", ":"],
413 " composition\r\nclassE ",
414 ["arrow", "o--"],
415 " classF ",
416 ["operator", ":"],
417 " association\r\n\r\n",
418
419 ["keyword", "classDiagram"],
420
421 "\r\n Customer ",
422 ["string", "\"1\""],
423 ["arrow", "-->"],
424 ["string", "\"*\""],
425 " Ticket\r\n Student ",
426 ["string", "\"1\""],
427 ["arrow", "-->"],
428 ["string", "\"1..*\""],
429 " Course\r\n Galaxy ",
430 ["arrow", "-->"],
431 ["string", "\"many\""],
432 " Star ",
433 ["operator", ":"],
434 " Contains\r\n\r\n",
435
436 ["keyword", "classDiagram"],
437 ["keyword", "class"], " Shape\r\n",
438 ["annotation", "<<interface>>"], " Shape\r\n\r\n",
439
440 ["keyword", "classDiagram"],
441 ["keyword", "class"],
442 " Shape",
443 ["punctuation", "{"],
444 ["annotation", "<<interface>>"],
445 "\r\n noOfVertices\r\n draw",
446 ["punctuation", "("],
447 ["punctuation", ")"],
448 ["punctuation", "}"],
449 ["keyword", "class"],
450 " Color",
451 ["punctuation", "{"],
452 ["annotation", "<<enumeration>>"],
453 "\r\n RED\r\n BLUE\r\n GREEN\r\n WHITE\r\n BLACK\r\n",
454 ["punctuation", "}"],
455
456 ["keyword", "classDiagram"],
457 ["comment", "%% This whole line is a comment classDiagram class Shape <<interface>>"],
458 ["keyword", "class"],
459 " Shape",
460 ["punctuation", "{"],
461 ["annotation", "<<interface>>"],
462 "\r\n noOfVertices\r\n draw",
463 ["punctuation", "("],
464 ["punctuation", ")"],
465 ["punctuation", "}"],
466
467 ["keyword", "classDiagram"],
468
469 ["keyword", "direction"],
470 " RL\r\n ",
471
472 ["keyword", "class"],
473 " Student ",
474 ["punctuation", "{"],
475
476 "\r\n -idCard ",
477 ["operator", ":"],
478 " IdCard\r\n ",
479
480 ["punctuation", "}"],
481
482 ["keyword", "class"],
483 " IdCard",
484 ["punctuation", "{"],
485
486 "\r\n -id ",
487 ["operator", ":"],
488 " int\r\n -name ",
489 ["operator", ":"],
490 " string\r\n ",
491
492 ["punctuation", "}"],
493
494 ["keyword", "class"],
495 " Bike",
496 ["punctuation", "{"],
497
498 "\r\n -id ",
499 ["operator", ":"],
500 " int\r\n -name ",
501 ["operator", ":"],
502 " string\r\n ",
503
504 ["punctuation", "}"],
505
506 "\r\n Student ",
507 ["string", "\"1\""],
508 ["arrow", "--o"],
509 ["string", "\"1\""],
510 " IdCard ",
511 ["operator", ":"],
512 " carries\r\n Student ",
513 ["string", "\"1\""],
514 ["arrow", "--o"],
515 ["string", "\"1\""],
516 " Bike ",
517 ["operator", ":"],
518 " rides\r\n\r\n",
519
520 ["keyword", "action"],
521 " className ",
522 ["string", "\"reference\""],
523 ["string", "\"tooltip\""],
524
525 ["keyword", "click"],
526 " className call callback",
527 ["punctuation", "("],
528 ["punctuation", ")"],
529 ["string", "\"tooltip\""],
530
531 ["keyword", "click"],
532 " className href ",
533 ["string", "\"url\""],
534 ["string", "\"tooltip\""],
535
536 ["keyword", "classDiagram"],
537
538 ["keyword", "class"],
539 " Shape\r\n",
540
541 ["keyword", "link"],
542 " Shape ",
543 ["string", "\"http://www.github.com\""],
544 ["string", "\"This is a tooltip for a link\""],
545
546 ["keyword", "class"],
547 " Shape2\r\n",
548
549 ["keyword", "click"],
550 " Shape2 href ",
551 ["string", "\"http://www.github.com\""],
552 ["string", "\"This is a tooltip for a link\""],
553
554 ["keyword", "classDiagram"],
555
556 ["keyword", "class"],
557 " Shape\r\n",
558
559 ["keyword", "callback"],
560 " Shape ",
561 ["string", "\"callbackFunction\""],
562 ["string", "\"This is a tooltip for a callback\""],
563
564 ["keyword", "class"],
565 " Shape2\r\n",
566
567 ["keyword", "click"],
568 " Shape2 call callbackFunction",
569 ["punctuation", "("],
570 ["punctuation", ")"],
571 ["string", "\"This is a tooltip for a callback\""],
572
573 ["keyword", "classDiagram"],
574
575 "\r\nAnimal ",
576 ["arrow", "<|--"],
577 " Duck\r\nAnimal ",
578 ["arrow", "<|--"],
579 " Fish\r\nAnimal ",
580 ["arrow", "<|--"],
581 " Zebra\r\nAnimal ",
582 ["operator", ":"],
583 " +int age\r\nAnimal ",
584 ["operator", ":"],
585 " +String gender\r\nAnimal",
586 ["operator", ":"],
587 " +isMammal",
588 ["punctuation", "("],
589 ["punctuation", ")"],
590
591 "\r\nAnimal",
592 ["operator", ":"],
593 " +mate",
594 ["punctuation", "("],
595 ["punctuation", ")"],
596
597 ["keyword", "class"],
598 " Duck",
599 ["punctuation", "{"],
600
601 "\r\n +String beakColor\r\n +swim",
602 ["punctuation", "("],
603 ["punctuation", ")"],
604
605 "\r\n +quack",
606 ["punctuation", "("],
607 ["punctuation", ")"],
608
609 ["punctuation", "}"],
610
611 ["keyword", "class"],
612 " Fish",
613 ["punctuation", "{"],
614
615 "\r\n -int sizeInFeet\r\n -canEat",
616 ["punctuation", "("],
617 ["punctuation", ")"],
618
619 ["punctuation", "}"],
620
621 ["keyword", "class"],
622 " Zebra",
623 ["punctuation", "{"],
624
625 "\r\n +bool is_wild\r\n +run",
626 ["punctuation", "("],
627 ["punctuation", ")"],
628
629 ["punctuation", "}"],
630
631 ["keyword", "callback"],
632 " Duck callback ",
633 ["string", "\"Tooltip\""],
634
635 ["keyword", "link"],
636 " Zebra ",
637 ["string", "\"http://www.github.com\""],
638 ["string", "\"This is a link\""],
639
640 ["keyword", "classDiagram"],
641 ["keyword", "class"], " Animal", ["operator", ":::"], "cssClass\r\n\r\n",
642
643 ["keyword", "classDiagram"],
644
645 ["keyword", "class"],
646 " Animal",
647 ["operator", ":::"],
648 "cssClass ",
649 ["punctuation", "{"],
650
651 "\r\n -int sizeInFeet\r\n -canEat",
652 ["punctuation", "("],
653 ["punctuation", ")"],
654
655 ["punctuation", "}"]
656 ]