PlantUML Class Diagrams
This page tests the English A11y descriptions for class diagrams.
Simple class diagram with 1 class
Class diagram with 3 classes and relationships
Extended class diagram with 5 classes and 4 relationships
Screen reader text (English):
Class diagram with 5 classes and 4 relationships.
Classes:
- Class WordList with:
- Private attribute words of type String Array
- Public method sort, without parameters, return type void
- Public method setSortStrategy with parameter strategy of type SortStrategy, return type void
- Interface SortStrategy with public method sort with parameter words of type String Array, return type void
- Class MergeSort with public method sort with parameter words of type String Array, return type void
- Class ShellSort with public method sort with parameter words of type String Array, return type void
- Class QuickSort with public method sort with parameter words of type String Array, return type void Relations:
- WordList has an association-relationship named 'currentStrategy' with SortStrategy, multiplicity 1
- MergeSort implements interface SortStrategy
- ShellSort implements interface SortStrategy
- QuickSort implements interface SortStrategy Notes:
- At class WordList: "The sort method calls currentStrategy.sort with words as parameter"
Simple class diagram without Out loud button
This diagram has the Out loud button hidden via the hideSpeakButton flag, demonstrating per-diagram control over the speak button.
Simple class diagram with hidden source
This diagram uses the hideSource flag. The source tab is hidden, while the natural language tab (including the Out loud button) remains available.
"WordList class (hidden source)" in natural language
Class diagram with 1 class(es) and 0 relation(s).
Classes:
- Class WordList
with:
- public method 'sort', without parameters, return type void
- private attribute 'words' of type String Array
Visual mode toggle with stereotypes and auto legend
This test case validates three things for PlantUML class diagrams:
For devs/Simplervisual mode toggle- custom stereotypes (for example
EntityandValue Object) are hidden inSimplermode - auto-generated legend is shown when
showDiagramLegendis enabled - advanced relation types are present for testing: inheritance, realization, dependency, composition, and aggregation
Reverse diamond notation (--o and --*)
This example verifies that reverse-direction diamond syntax is parsed correctly and still shown as advanced relations in For devs mode.