https://github.com/jboz/plantuml-builder
Plantuml diagram from java sources
https://github.com/jboz/plantuml-builder
java maven maven-plugin plantuml
Last synced: 8 months ago
JSON representation
Plantuml diagram from java sources
- Host: GitHub
- URL: https://github.com/jboz/plantuml-builder
- Owner: jboz
- License: apache-2.0
- Created: 2017-04-27T23:14:47.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2024-01-15T15:36:55.000Z (over 2 years ago)
- Last Synced: 2025-07-27T06:47:29.189Z (11 months ago)
- Topics: java, maven, maven-plugin, plantuml
- Language: Java
- Homepage:
- Size: 208 KB
- Stars: 47
- Watchers: 3
- Forks: 10
- Open Issues: 5
-
Metadata Files:
- Readme: README.asciidoc
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
ifdef::env-github[:toc: macro]
ifndef::env-site[:toc: preamble]
ifndef::imagesdir[:imagesdir: images]
:icons: font
:source-highlighter: coderay
:source-language: asciidoc
image:https://img.shields.io/badge/PRs-welcome-brightgreen.svg["Make a pull request", link="http://makeapullrequest.com"]
image:https://img.shields.io/github/license/spotify/dockerfile-maven.svg[License]
image:https://maven-badges.herokuapp.com/maven-central/ch.ifocusit/plantuml-builder/badge.svg?style=flat["Maven Central", link="https://maven-badges.herokuapp.com/maven-central/ch.ifocusit/plantuml-builder"]
= Plantuml builder
A tools to generate plantuml diagram from java sources.
This tool is an important part of the https://github.com/jboz/living-documentation[Living Documentation tool].
Using a builder pattern, the class `ClassDiagramBuilder` give you many way to construct and customize the diagram.
== Class diagram example
This code :
[source,java]
----
String diagram = new ClassDiagramBuilder()
.addClasses(Vehicule.class, Car.class, Driver.class, Price.class, Wheel.class, Devise.class)
.build();
----
Will generate this :
[source]
----
@startuml
interface Vehicule
class Car {
brand : String
model : String
driver : Driver
price : Price
wheels : Collection
}
class Driver {
name : String
cars : List
}
class Price {
amount : BigDecimal
devise : Devise
}
class Wheel
enum Devise {
CHF
EUR
USD
}
Vehicule <|-- Car
Car "*" <-> Driver : driver
Car --> Price : price
Car --> "*" Wheel : wheels
Price --> Devise : devise
@enduml
----
And if you render an image from this previous text file you will get :
image::class-diagram.png[Asciidoctor Diagram classes diagram]
=== For more uses cases and more options see https://github.com/jboz/plantuml-builder/blob/master/src/test/java/ch/ifocusit/plantuml/classdiagram/ClassDiagramBuilderTest.java[**ClassDiagramBuilderTest**] or https://github.com/jboz/plantuml-builder/blob/master/src/test/java/ch/ifocusit/plantuml/PlantUmlBuilderTest.java[**PlantUmlBuilderTest**] classes