Class Documenter

java.lang.Object
org.springframework.modulith.docs.Documenter

public class Documenter extends Object
API to create documentation for ApplicationModules.
Author:
Oliver Drotbohm, Cora Iberkleid, Tobias Haindl, Alexander Miller
  • Constructor Details

    • Documenter

      public Documenter(Class<?> modulithType)
      Creates a new Documenter for the ApplicationModules created for the given modulith type in the default output folder (spring-modulith-docs).
      Parameters:
      modulithType - must not be null.
    • Documenter

      public Documenter(org.springframework.modulith.core.ApplicationModules modules)
      Creates a new Documenter for the given ApplicationModules instance in the default output folder (spring-modulith-docs).
      Parameters:
      modules - must not be null.
    • Documenter

      @Deprecated(forRemoval=true) public Documenter(org.springframework.modulith.core.ApplicationModules modules, String outputFolder)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new Documenter for the given ApplicationModules and output folder.
      Parameters:
      modules - must not be null.
      outputFolder - must not be null or empty.
    • Documenter

      public Documenter(org.springframework.modulith.core.ApplicationModules modules, Documenter.Options options)
      Creates a new Documenter for the given ApplicationModules and output folder.
      Parameters:
      modules - must not be null.
      options - must not be null.
      Since:
      1.2
  • Method Details

    • writeDocumentation

      public Documenter writeDocumentation()
      Writes all available documentation:
      • The entire set of modules as overview component diagram.
      • Individual component diagrams per module to include all upstream modules.
      • The Module Canvas for each module.
      using Documenter.DiagramOptions.defaults() and Documenter.CanvasOptions.defaults().
      Returns:
      the current instance, will never be null.
    • writeDocumentation

      public Documenter writeDocumentation(Documenter.DiagramOptions diagramOptions, Documenter.CanvasOptions canvasOptions)
      Writes all available documentation:
      • The entire set of modules as overview component diagram.
      • Individual component diagrams per module to include all upstream modules.
      • The Module Canvas for each module.
      Parameters:
      diagramOptions - must not be null.
      canvasOptions - must not be null.
      Returns:
      the current instance, will never be null.
    • writeAggregatingDocument

      public Documenter writeAggregatingDocument()
      Writes aggregating document called all-docs.adoc that includes any existing component diagrams and canvases. using Documenter.DiagramOptions.defaults() and Documenter.CanvasOptions.defaults().
      Returns:
      the current instance, will never be null.
      Since:
      1.2.2
    • writeAggregatingDocument

      public Documenter writeAggregatingDocument(Documenter.DiagramOptions diagramOptions, Documenter.CanvasOptions canvasOptions)
      Writes aggregating document called all-docs.adoc that includes any existing component diagrams and canvases.
      Parameters:
      diagramOptions - must not be null.
      canvasOptions - must not be null.
      Returns:
      the current instance, will never be null.
      Since:
      1.2.2
    • writeModulesAsPlantUml

      public Documenter writeModulesAsPlantUml()
      Writes the PlantUML component diagram for all ApplicationModules using Documenter.DiagramOptions.defaults().
      Returns:
      the current instance, will never be null.
    • writeModulesAsPlantUml

      public Documenter writeModulesAsPlantUml(Documenter.DiagramOptions diagramOptions)
      Writes the PlantUML component diagram for all ApplicationModules with the given Documenter.DiagramOptions.
      Parameters:
      diagramOptions - must not be null.
      Returns:
      the current instance, will never be null.
    • writeIndividualModulesAsPlantUml

      public Documenter writeIndividualModulesAsPlantUml()
    • writeIndividualModulesAsPlantUml

      public Documenter writeIndividualModulesAsPlantUml(Documenter.DiagramOptions options)
      Writes the component diagrams for all individual modules.
      Parameters:
      options - must not be null.
      Returns:
      the current instance, will never be null.
    • writeModuleAsPlantUml

      public Documenter writeModuleAsPlantUml(org.springframework.modulith.core.ApplicationModule module)
      Writes the PlantUML component diagram for the given ApplicationModule.
      Parameters:
      module - must not be null.
      Returns:
      the current instance, will never be null.
    • writeModuleAsPlantUml

      public Documenter writeModuleAsPlantUml(org.springframework.modulith.core.ApplicationModule module, Documenter.DiagramOptions options)
      Writes the PlantUML component diagram for the given ApplicationModule with the given rendering Documenter.DiagramOptions.
      Parameters:
      module - must not be null.
      options - must not be null.
      Returns:
      the current instance, will never be null.
    • writeModuleCanvases

      public Documenter writeModuleCanvases()
      Writes all module canvases using Documenter.DiagramOptions.defaults().
      Returns:
      the current instance, will never be null.
    • writeModuleCanvases

      public Documenter writeModuleCanvases(Documenter.CanvasOptions canvasOptions)
      Writes all module canvases using the given Documenter.DiagramOptions.
      Parameters:
      canvasOptions - must not be null.
      Returns:
      the current instance, will never be null.
    • writeModuleMetadata

      public Documenter writeModuleMetadata()
      Writes application module metadata to the build folder for inclusion at runtime.
      Returns:
      will never be null.
      Since:
      1.4
      See Also:
      • ApplicationModulesExporter
    • toModuleCanvas

      String toModuleCanvas(org.springframework.modulith.core.ApplicationModule module)
    • toModuleCanvas

      String toModuleCanvas(org.springframework.modulith.core.ApplicationModule module, String apiBase)
    • toModuleCanvas

      String toModuleCanvas(org.springframework.modulith.core.ApplicationModule module, Documenter.CanvasOptions options)
    • getModules

      org.springframework.modulith.core.ApplicationModules getModules()
    • toPlantUml

      String toPlantUml()