Schematex
umlclass·OMG UML 2.5.1 §9–§11·software·complexity 2/3·since v0.6.4

Generics and Mermaid-compatible syntax

A generic repository written in Mermaid classDiagram shorthand — tilde-generics, single-line members, and member classifiers — all rendered with standard-correct adornments, so a Mermaid snippet migrates in one line.

For the developer migrating from Mermaid

Open in Playground →
schematex§ source-defined
UML class diagram UML class diagram: 2 class; 1 realization (1 warning). Repository<T> + cache: Map> + count + findAll(): List + findById(id: ID): Optional + flush() «service» CrudService + repo: Repository + save(e: User): User T
13 lines · 294 chars
✓ parsed·0.0 ms·0 B
100%

What this shows

The same diagram a developer would paste from a Mermaid classDiagram, rendered with Schematex's standard-correct adornments and layered layout.

Tilde-generics convert to angle brackets: List~T~List<T>, and they nest — Map~String,List~int~~Map<String,List<int>>. The generic also works on the class name itself (class Repository~T~Repository<T>).

Single-line members append to a class: CrudService : +repo : Repository~User~ adds an attribute, and CrudService : <<service>> sets the stereotype — no { … } block required.

Member classifiers are the Mermaid suffixes: flush()* marks an abstract operation (rendered italic) and count$ a static member (rendered underlined). Return types may be space-separated (findAll() List~T~) the way Mermaid writes them. A lone leading ~ is still the package-visibility glyph, so the two never collide.

UML class diagram syntax