Search in sources :

Example 1 with Diagram

use of com.structurizr.io.Diagram in project moduliths by moduliths.

the class Documenter method render.

private String render(ComponentView view, Options options) {
    switch(options.style) {
        case C4:
            C4PlantUMLExporter exporter = new C4PlantUMLExporter();
            Diagram diagram = exporter.export(view);
            return diagram.getDefinition();
        case UML:
        default:
            Writer writer = new StringWriter();
            PlantUMLWriter umlWriter = new BasicPlantUMLWriter();
            umlWriter.addSkinParam("componentStyle", "uml1");
            umlWriter.write(view, writer);
            return writer.toString();
    }
}
Also used : C4PlantUMLExporter(com.structurizr.io.plantuml.C4PlantUMLExporter) StringWriter(java.io.StringWriter) BasicPlantUMLWriter(com.structurizr.io.plantuml.BasicPlantUMLWriter) BasicPlantUMLWriter(com.structurizr.io.plantuml.BasicPlantUMLWriter) PlantUMLWriter(com.structurizr.io.plantuml.PlantUMLWriter) BasicPlantUMLWriter(com.structurizr.io.plantuml.BasicPlantUMLWriter) Writer(java.io.Writer) StringWriter(java.io.StringWriter) FileWriter(java.io.FileWriter) PlantUMLWriter(com.structurizr.io.plantuml.PlantUMLWriter) Diagram(com.structurizr.io.Diagram)

Aggregations

Diagram (com.structurizr.io.Diagram)1 BasicPlantUMLWriter (com.structurizr.io.plantuml.BasicPlantUMLWriter)1 C4PlantUMLExporter (com.structurizr.io.plantuml.C4PlantUMLExporter)1 PlantUMLWriter (com.structurizr.io.plantuml.PlantUMLWriter)1 FileWriter (java.io.FileWriter)1 StringWriter (java.io.StringWriter)1 Writer (java.io.Writer)1