Skip to content

Latest commit

 

History

History
84 lines (66 loc) · 2.22 KB

README.asciidoc

File metadata and controls

84 lines (66 loc) · 2.22 KB

Build Status Make a pull request License Maven Central

Plantuml builder

Tools to generate plantuml diagram from java sources.

This generated diagrams are an important part of the Living Documentation tool

class diagram

This code :

String diagram = new ClassDiagramBuilder()
        .addClasses(Vehicule.class, Car.class, Driver.class, Price.class, Wheel.class, Devise.class)
        .build();

Will get :

@startuml

+class "Car" {
  -ignored : Long
  -brand : String
  -model : String
  -drivers : Set<Driver>
  -price : Price
  -wheels : Collection<Wheel>
  +addDriver(Driver) : Car
  +addWheel(Wheel)
  +buyBy(Driver, BigDecimal, Devise) : Driver
}

+enum "Devise" {
  +CHF
  +EUR
  +USD
}

+class "Driver" {
  -name : String
  -ignored : Long
  -cars : List<Car>
  +addCar(Car)
  +buy(Car)
}

+class "Price" {
  -amount : BigDecimal
  -devise : Devise
}

+interface "Vehicule" {
}

+class "Wheel" {
}

"Car" --> "Devise" : use
"Car" "*" <-> "*" "Driver" : drivers/cars
"Car" --> "Price" : price
"Car" --> "*" "Wheel" : wheels
"Price" --> "Devise" : devise
"Vehicule" <|-- "Car"

@enduml
Asciidoctor Diagram classes diagram

For more uses cases, more options see ClassDiagramBuilderTest or PlantUmlBuilderTest classes