Package com.structurizr.documentation
Class DocumentationTemplate
java.lang.Object
com.structurizr.documentation.DocumentationTemplate
- Direct Known Subclasses:
Arc42DocumentationTemplate
,AutomaticDocumentationTemplate
,StructurizrDocumentationTemplate
,ViewpointsAndPerspectivesDocumentationTemplate
public abstract class DocumentationTemplate
extends java.lang.Object
The superclass for all documentation templates.
-
Constructor Summary
Constructors Constructor Description DocumentationTemplate(Workspace workspace)
Creates a new documentation template for the given workspace. -
Method Summary
Modifier and Type Method Description Image
addImage(java.io.File file)
Adds an image from the given file to the workspace.java.util.Collection<Image>
addImages(java.io.File path)
Adds png/jpg/jpeg/gif images in the given directory to the workspace.Section
addSection(Component component, java.lang.String title, Format format, java.lang.String content)
Adds a section relating to aComponent
.Section
addSection(Component component, java.lang.String title, java.io.File... files)
Adds a section relating to aComponent
from one or more files.Section
addSection(Container container, java.lang.String title, Format format, java.lang.String content)
Adds a section relating to aContainer
.Section
addSection(Container container, java.lang.String title, java.io.File... files)
Adds a section relating to aContainer
from one or more files.Section
addSection(SoftwareSystem softwareSystem, java.lang.String title, Format format, java.lang.String content)
Adds a section relating to aSoftwareSystem
.Section
addSection(SoftwareSystem softwareSystem, java.lang.String title, java.io.File... files)
Adds a section relating to aSoftwareSystem
from one or more files.Section
addSection(java.lang.String title, Format format, java.lang.String content)
Adds a custom section, that isn't related to any element in the model.Section
addSection(java.lang.String title, java.io.File... files)
Adds a custom section from one or more files, that isn't related to any element in the model.protected abstract TemplateMetadata
getMetadata()
Gets the metadata associated with this template.
-
Constructor Details
-
DocumentationTemplate
Creates a new documentation template for the given workspace.- Parameters:
workspace
- the Workspace instance to create documentation for
-
-
Method Details
-
addSection
public Section addSection(java.lang.String title, java.io.File... files) throws java.io.IOExceptionAdds a custom section from one or more files, that isn't related to any element in the model.- Parameters:
title
- the section titlefiles
- one or more File objects that point to the documentation content- Returns:
- a documentation
Section
- Throws:
java.io.IOException
- if there is an error reading the files
-
addSection
@Nonnull public Section addSection(java.lang.String title, Format format, java.lang.String content)Adds a custom section, that isn't related to any element in the model. -
addSection
@Nonnull public Section addSection(SoftwareSystem softwareSystem, java.lang.String title, java.io.File... files) throws java.io.IOExceptionAdds a section relating to aSoftwareSystem
from one or more files.- Parameters:
softwareSystem
- theSoftwareSystem
the documentation content relates totitle
- the section titlefiles
- one or more File objects that point to the documentation content- Returns:
- a documentation
Section
- Throws:
java.io.IOException
- if there is an error reading the files
-
addSection
public Section addSection(SoftwareSystem softwareSystem, java.lang.String title, Format format, java.lang.String content)Adds a section relating to aSoftwareSystem
.- Parameters:
softwareSystem
- theSoftwareSystem
the documentation content relates totitle
- the section titleformat
- theFormat
of the documentation contentcontent
- a String containing the documentation content- Returns:
- a documentation
Section
-
addSection
public Section addSection(Container container, java.lang.String title, java.io.File... files) throws java.io.IOExceptionAdds a section relating to aContainer
from one or more files. -
addSection
public Section addSection(Container container, java.lang.String title, Format format, java.lang.String content)Adds a section relating to aContainer
. -
addSection
public Section addSection(Component component, java.lang.String title, java.io.File... files) throws java.io.IOExceptionAdds a section relating to aComponent
from one or more files. -
addSection
public Section addSection(Component component, java.lang.String title, Format format, java.lang.String content)Adds a section relating to aComponent
. -
addImages
Adds png/jpg/jpeg/gif images in the given directory to the workspace.- Parameters:
path
- a File descriptor representing a directory on disk- Returns:
- a Collection of Image objects
- Throws:
java.io.IOException
- if the path can't be accessed
-
addImage
Adds an image from the given file to the workspace.- Parameters:
file
- a File descriptor representing an image file on disk- Returns:
- an Image object representing the image added
- Throws:
java.io.IOException
- if there is an error reading the image
-
getMetadata
Gets the metadata associated with this template.- Returns:
- a TemplateMetadata object, or null if there is none
-