Skip to content

Commit ae91d82

Browse files
Adds documentation to components.
1 parent af62689 commit ae91d82

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ subprojects { proj ->
88

99
description = 'Structurizr'
1010
group = 'com.structurizr'
11-
version = '1.21.0'
11+
version = '1.22.0'
1212

1313
repositories {
1414
mavenCentral()

docs/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.22.0 (5th March 2023)
4+
5+
- Adds documentation to components.
6+
37
## 1.21.0 (26th February 2023)
48

59
- __Breaking change__: Removes the concept of "code elements" from `Component`.

structurizr-core/src/com/structurizr/model/Component.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.structurizr.model;
22

33
import com.fasterxml.jackson.annotation.JsonIgnore;
4+
import com.structurizr.documentation.Documentable;
5+
import com.structurizr.documentation.Documentation;
46

57
import java.util.Arrays;
68
import java.util.LinkedHashSet;
@@ -9,12 +11,14 @@
911
/**
1012
* Represents a "component" in the C4 model.
1113
*/
12-
public final class Component extends StaticStructureElement {
14+
public final class Component extends StaticStructureElement implements Documentable {
1315

1416
private Container parent;
1517

1618
private String technology;
1719

20+
private Documentation documentation = new Documentation();
21+
1822
Component() {
1923
}
2024

@@ -67,4 +71,22 @@ public Set<String> getDefaultTags() {
6771
return new LinkedHashSet<>(Arrays.asList(Tags.ELEMENT, Tags.COMPONENT));
6872
}
6973

74+
/**
75+
* Gets the documentation associated with this component.
76+
*
77+
* @return a Documentation object
78+
*/
79+
public Documentation getDocumentation() {
80+
return documentation;
81+
}
82+
83+
/**
84+
* Sets the documentation associated with this component.
85+
*
86+
* @param documentation a Documentation object
87+
*/
88+
void setDocumentation(Documentation documentation) {
89+
this.documentation = documentation;
90+
}
91+
7092
}

0 commit comments

Comments
 (0)