Skip to content

Commit

Permalink
Adds documentation to components.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrowndotje committed Mar 5, 2023
1 parent af62689 commit ae91d82
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ subprojects { proj ->

description = 'Structurizr'
group = 'com.structurizr'
version = '1.21.0'
version = '1.22.0'

repositories {
mavenCentral()
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.22.0 (5th March 2023)

- Adds documentation to components.

## 1.21.0 (26th February 2023)

- __Breaking change__: Removes the concept of "code elements" from `Component`.
Expand Down
24 changes: 23 additions & 1 deletion structurizr-core/src/com/structurizr/model/Component.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.structurizr.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.structurizr.documentation.Documentable;
import com.structurizr.documentation.Documentation;

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

private Container parent;

private String technology;

private Documentation documentation = new Documentation();

Component() {
}

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

/**
* Gets the documentation associated with this component.
*
* @return a Documentation object
*/
public Documentation getDocumentation() {
return documentation;
}

/**
* Sets the documentation associated with this component.
*
* @param documentation a Documentation object
*/
void setDocumentation(Documentation documentation) {
this.documentation = documentation;
}

}

0 comments on commit ae91d82

Please sign in to comment.