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 →
classdiagram·§
↘ preview
100%
UML class diagram UML class diagram: 2 class; 1 realization (1 warning). Repository<T> + cache: Map<String,List<int>> + count + findAll(): List<T> + findById(id: ID): Optional<T> + flush() «service» CrudService + repo: Repository<User> + save(e: User): User T
UTF-8 · LF · 13 lines · 294 chars✓ parsed·12.6 ms·5.0 KB SVG

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