Package com.structurizr.io.plantuml
Class C4PlantUMLWriter
- java.lang.Object
-
- com.structurizr.io.plantuml.PlantUMLWriter
-
- com.structurizr.io.plantuml.BasicPlantUMLWriter
-
- com.structurizr.io.plantuml.C4PlantUMLWriter
-
public class C4PlantUMLWriter extends BasicPlantUMLWriter
This writer extends the classical one to use the C4-PlantUML sprite library available on GitHub. To make full use of that sprite library, we use Structurizr properties to tweak rendering. It is possible to change relationships directions and rendering using theC4_LAYOUT_DIRECTIONandC4_LAYOUT_MODEmode properties.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classC4PlantUMLWriter.Directionsstatic classC4PlantUMLWriter.LayoutVarious layout abilities as provided by C4-PlantUMLstatic classC4PlantUMLWriter.NoMacroFoundstatic classC4PlantUMLWriter.RelationshipModesstatic classC4PlantUMLWriter.Type
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringC4_ELEMENT_TYPEDefines theC4PlantUMLWriter.Typeof component.static java.lang.StringC4_LAYOUT_DIRECTIONThis property indicates to C4-PlantUML library which relationship type to use.static java.lang.StringC4_LAYOUT_MODEThis property indicates to C4-PlantUML library which relationship mode to use.
-
Constructor Summary
Constructors Constructor Description C4PlantUMLWriter()C4PlantUMLWriter(C4PlantUMLWriter.Layout layout, java.lang.String c4PlantUMLBaseUrl)Constructur providing a base url and a layoutC4PlantUMLWriter(C4PlantUMLWriter.Layout layout, java.util.Collection<java.lang.String> c4PlantUMLIncludes)Constructor providing the layout and the full list of includes to use
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.Collection<java.lang.String>inferC4PlantUMLLibraryFrom(java.lang.String urlText)protected voidwrite(com.structurizr.view.View view, com.structurizr.model.Element element, java.io.Writer writer, int indent)We replace the write element method to use macros provided by C4-PlantUMLprotected voidwriteContainerForContainer(com.structurizr.view.ComponentView view, java.io.Writer writer, java.util.function.BiConsumer<com.structurizr.view.ComponentView,java.io.Writer> packageContentWriter)protected voidwriteContainerForSoftwareSystem(com.structurizr.view.ContainerView view, java.io.Writer writer, java.util.function.BiConsumer<com.structurizr.view.ContainerView,java.io.Writer> packageContentWriter)protected voidwriteRelationship(com.structurizr.view.View view, com.structurizr.view.RelationshipView relationshipView, java.io.Writer writer)-
Methods inherited from class com.structurizr.io.plantuml.BasicPlantUMLWriter
getDirection, isIncludeNotesForActors, setDirection, setIncludeNotesForActors, write, write, write, write
-
Methods inherited from class com.structurizr.io.plantuml.PlantUMLWriter
addIncludeFile, addIncludeFile, addIncludeFile, addIncludeURL, addIncludeURL, addIncludeURL, addSkinParam, clearIncludes, clearSkinParams, getIncludes, getSkinParams, isIncludeDiagramMetadata, isUseSequenceDiagrams, setIncludeDiagramMetadata, setUseSequenceDiagrams, toPlantUMLDiagrams, toString, write, write, write, write, writeFooter, writeHeader, writeRelationships
-
-
-
-
Field Detail
-
C4_LAYOUT_DIRECTION
public static final java.lang.String C4_LAYOUT_DIRECTION
This property indicates to C4-PlantUML library which relationship type to use. Possible values are given in theC4PlantUMLWriter.Directionsenum- See Also:
- Constant Field Values
-
C4_LAYOUT_MODE
public static final java.lang.String C4_LAYOUT_MODE
This property indicates to C4-PlantUML library which relationship mode to use. Possible values are given in theC4PlantUMLWriter.RelationshipModesenum- See Also:
- Constant Field Values
-
C4_ELEMENT_TYPE
public static final java.lang.String C4_ELEMENT_TYPE
Defines theC4PlantUMLWriter.Typeof component.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
C4PlantUMLWriter
public C4PlantUMLWriter()
-
C4PlantUMLWriter
public C4PlantUMLWriter(C4PlantUMLWriter.Layout layout, java.lang.String c4PlantUMLBaseUrl)
Constructur providing a base url and a layout- Parameters:
layout- layout to use for each graphc4PlantUMLBaseUrl- base url of repository. The following GitHub url kinds are supported- raw content (i.e. "https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/")
- Official repository name with branch or tag (i.e. "https://github.com/plantuml-stdlib/C4-PlantUML/tree/master")
- Official repository name without branch. Master is assumed in that case (i.ie "https://github.com/plantuml-stdlib/C4-PlantUML/")
- See Also:
inferC4PlantUMLLibraryFrom(java.lang.String)
-
C4PlantUMLWriter
public C4PlantUMLWriter(C4PlantUMLWriter.Layout layout, java.util.Collection<java.lang.String> c4PlantUMLIncludes)
Constructor providing the layout and the full list of includes to use- Parameters:
layout- layout to use for each graphc4PlantUMLIncludes- full list of C4PlantUML brushes. It should include C4.puml, C4_Context.puml, C4_Container.puml and C4_Component.puml.
-
-
Method Detail
-
inferC4PlantUMLLibraryFrom
public static java.util.Collection<java.lang.String> inferC4PlantUMLLibraryFrom(java.lang.String urlText)
-
writeContainerForSoftwareSystem
protected void writeContainerForSoftwareSystem(com.structurizr.view.ContainerView view, java.io.Writer writer, java.util.function.BiConsumer<com.structurizr.view.ContainerView,java.io.Writer> packageContentWriter) throws java.io.IOException- Overrides:
writeContainerForSoftwareSystemin classBasicPlantUMLWriter- Throws:
java.io.IOException
-
writeContainerForContainer
protected void writeContainerForContainer(com.structurizr.view.ComponentView view, java.io.Writer writer, java.util.function.BiConsumer<com.structurizr.view.ComponentView,java.io.Writer> packageContentWriter) throws java.io.IOException- Overrides:
writeContainerForContainerin classBasicPlantUMLWriter- Throws:
java.io.IOException
-
write
protected void write(com.structurizr.view.View view, com.structurizr.model.Element element, java.io.Writer writer, int indent)We replace the write element method to use macros provided by C4-PlantUML- Overrides:
writein classBasicPlantUMLWriter
-
writeRelationship
protected void writeRelationship(com.structurizr.view.View view, com.structurizr.view.RelationshipView relationshipView, java.io.Writer writer)- Overrides:
writeRelationshipin classBasicPlantUMLWriter
-
-