Class Documenter.DiagramOptions
java.lang.Object
org.springframework.modulith.docs.Documenter.DiagramOptions
- Enclosing class:
- Documenter
Options to tweak the rendering of diagrams.
- Author:
- Oliver Drotbohm
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Different diagram styles.static enum
Configuration setting to define whether modules that do not have a relationship to any other module shall be retained in the diagrams created. -
Constructor Summary
ConstructorDescriptionDiagramOptions
(Set<DependencyType> dependencyTypes, DependencyDepth dependencyDepth, Predicate<ApplicationModule> exclusions, Predicate<com.structurizr.model.Component> componentFilter, Predicate<ApplicationModule> targetOnly, String targetFileName, Function<ApplicationModule, Optional<String>> colorSelector, Function<ApplicationModule, String> defaultDisplayName, Documenter.DiagramOptions.DiagramStyle style, Documenter.DiagramOptions.ElementsWithoutRelationships elementsWithoutRelationships) -
Method Summary
Modifier and TypeMethodDescriptionstatic Documenter.DiagramOptions
defaults()
Creates a new defaultDocumenter.DiagramOptions
instance configured to use all dependency types, list immediate dependencies for individual module instances, not applying any kind ofApplicationModule
orComponent
filters and default file names.withColorSelector
(Function<ApplicationModule, Optional<String>> colorSelector) A callback to return a hex-encoded color perApplicationModule
.withComponentFilter
(Predicate<com.structurizr.model.Component> componentFilter) APredicate
to define which StructurizrComponent
s to be included in the diagram to be created.withDefaultDisplayName
(Function<ApplicationModule, String> defaultDisplayName) A callback to return a default display names for a givenApplicationModule
.withDependencyDepth
(DependencyDepth dependencyDepth) TheDependencyDepth
to define which other modules to be included in the diagram to be created.withDependencyTypes
(DependencyType... types) Select the dependency types that are supposed to be included in the diagram to be created.withElementsWithoutRelationships
(Documenter.DiagramOptions.ElementsWithoutRelationships elementsWithoutRelationships) Configuration setting to define whether modules that do not have a relationship to any other module shall be retained in the diagrams created.withExclusions
(Predicate<ApplicationModule> exclusions) APredicate
to define the which modules to exclude from the diagram to be created.Which style to render the diagram in.withTargetFileName
(String targetFileName) The target file name to be used for the diagram to be created.withTargetOnly
(Predicate<ApplicationModule> targetOnly) APredicate
to define which of the modules shall only be considered targets, i.e.
-
Constructor Details
-
DiagramOptions
DiagramOptions(Set<DependencyType> dependencyTypes, DependencyDepth dependencyDepth, Predicate<ApplicationModule> exclusions, Predicate<com.structurizr.model.Component> componentFilter, Predicate<ApplicationModule> targetOnly, @Nullable String targetFileName, Function<ApplicationModule, Optional<String>> colorSelector, Function<ApplicationModule, String> defaultDisplayName, Documenter.DiagramOptions.DiagramStyle style, Documenter.DiagramOptions.ElementsWithoutRelationships elementsWithoutRelationships) - Parameters:
dependencyTypes
- must not be null.dependencyDepth
- must not be null.exclusions
- must not be null.componentFilter
- must not be null.targetOnly
- must not be null.targetFileName
- can be null.colorSelector
- must not be null.defaultDisplayName
- must not be null.style
- must not be null.elementsWithoutRelationships
- must not be null.
-
-
Method Details
-
withDependencyDepth
TheDependencyDepth
to define which other modules to be included in the diagram to be created. -
withExclusions
APredicate
to define the which modules to exclude from the diagram to be created. -
withComponentFilter
public Documenter.DiagramOptions withComponentFilter(Predicate<com.structurizr.model.Component> componentFilter) APredicate
to define which StructurizrComponent
s to be included in the diagram to be created. -
withTargetOnly
APredicate
to define which of the modules shall only be considered targets, i.e. all efferent relationships are going to be hidden from the rendered view. Modules that have no incoming relationships will entirely be removed from the view. -
withTargetFileName
The target file name to be used for the diagram to be created. For individual module diagrams this needs to include a%s
placeholder for the module names. -
withColorSelector
public Documenter.DiagramOptions withColorSelector(Function<ApplicationModule, Optional<String>> colorSelector) A callback to return a hex-encoded color perApplicationModule
. -
withDefaultDisplayName
public Documenter.DiagramOptions withDefaultDisplayName(Function<ApplicationModule, String> defaultDisplayName) A callback to return a default display names for a givenApplicationModule
. Default implementation just forwards toApplicationModule.getDisplayName()
. -
withStyle
Which style to render the diagram in. Defaults toDocumenter.DiagramOptions.DiagramStyle.UML
. -
withElementsWithoutRelationships
public Documenter.DiagramOptions withElementsWithoutRelationships(Documenter.DiagramOptions.ElementsWithoutRelationships elementsWithoutRelationships) Configuration setting to define whether modules that do not have a relationship to any other module shall be retained in the diagrams created. The default isDocumenter.DiagramOptions.ElementsWithoutRelationships.HIDDEN
. SeewithExclusions(Predicate)
for a more fine-grained way of defining which modules to exclude in case you flip this toDocumenter.DiagramOptions.ElementsWithoutRelationships.VISIBLE
.- See Also:
-
defaults
Creates a new defaultDocumenter.DiagramOptions
instance configured to use all dependency types, list immediate dependencies for individual module instances, not applying any kind ofApplicationModule
orComponent
filters and default file names.- Returns:
- will never be null.
-
withDependencyTypes
Select the dependency types that are supposed to be included in the diagram to be created.- Parameters:
types
- must not be null.- Returns:
-