Package com.structurizr.model
Class StaticStructureElement
java.lang.Object
com.structurizr.model.Element
com.structurizr.model.StaticStructureElement
- Direct Known Subclasses:
Component
,Container
,Person
,SoftwareSystem
public abstract class StaticStructureElement extends Element
This is the superclass for model elements that describe the static structure
of a software system, namely Person, SoftwareSystem, Container and Component.
-
Constructor Summary
Constructors Modifier Constructor Description protected
StaticStructureElement()
-
Method Summary
Modifier and Type Method Description Perspective
addPerspective(java.lang.String name, java.lang.String description)
Adds a perspective to this model item.void
addProperty(java.lang.String name, java.lang.String value)
Adds a name-value pair property to this element.void
addTags(java.lang.String... tags)
Relationship
delivers(Person destination, java.lang.String description)
Adds a unidirectional relationship between this element and a person.Relationship
delivers(Person destination, java.lang.String description, java.lang.String technology)
Adds a unidirectional relationship between this element and a person.Relationship
delivers(Person destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle)
Adds a unidirectional relationship between this element and a person.java.lang.String
getId()
Gets the ID of this item in the model.java.lang.String
getOriginId()
java.util.Set<Perspective>
getPerspectives()
Gets the set of perspectives associated with this model item.java.util.Map<java.lang.String,java.lang.String>
getProperties()
Gets the collection of name-value property pairs associated with this element, as a Map.protected abstract java.util.Set<java.lang.String>
getRequiredTags()
java.lang.String
getTags()
Gets the comma separated list of tags.java.util.Set<java.lang.String>
getTagsAsSet()
boolean
hasTag(java.lang.String tag)
Determines whether this model item has the given tag.boolean
removeTag(java.lang.String tag)
Removes the given tag.Relationship
uses(Component destination, java.lang.String description)
Adds a unidirectional "uses" style relationship between this element and component.Relationship
uses(Component destination, java.lang.String description, java.lang.String technology)
Adds a unidirectional "uses" style relationship between this element and a component.Relationship
uses(Component destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle)
Adds a unidirectional "uses" style relationship between this element and a component.Relationship
uses(Container destination, java.lang.String description)
Adds a unidirectional "uses" style relationship between this element and container.Relationship
uses(Container destination, java.lang.String description, java.lang.String technology)
Adds a unidirectional "uses" style relationship between this element and a container.Relationship
uses(Container destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle)
Adds a unidirectional "uses" style relationship between this element and a container.Relationship
uses(SoftwareSystem destination, java.lang.String description)
Adds a unidirectional "uses" style relationship between this element and software system.Relationship
uses(SoftwareSystem destination, java.lang.String description, java.lang.String technology)
Adds a unidirectional "uses" style relationship between this element and a software system.Relationship
uses(SoftwareSystem destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle)
Adds a unidirectional "uses" style relationship between this element and a software system.Relationship
uses(StaticStructureElement destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle)
Adds a unidirectional "uses" style relationship between this element and the specified element.Methods inherited from class com.structurizr.model.Element
getCanonicalName, getDescription, getEfferentRelationshipsWith, getEfferentRelationshipWith, getEfferentRelationshipWith, getModel, getName, getParent, getRelationships, getUrl, hasAfferentRelationships, hasEfferentRelationshipWith, hasEfferentRelationshipWith, setDescription, setModel, setUrl, toString
-
Constructor Details
-
StaticStructureElement
protected StaticStructureElement()
-
-
Method Details
-
uses
@Nullable public Relationship uses(@Nonnull SoftwareSystem destination, java.lang.String description)Adds a unidirectional "uses" style relationship between this element and software system.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "uses", "gets data from", "sends data to")- Returns:
- the relationship that has just been created and added to the model
-
uses
@Nullable public Relationship uses(@Nonnull SoftwareSystem destination, java.lang.String description, java.lang.String technology)Adds a unidirectional "uses" style relationship between this element and a software system.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "uses", "gets data from", "sends data to")technology
- the technology details (e.g. JSON/HTTPS)- Returns:
- the relationship that has just been created and added to the model
-
uses
@Nullable public Relationship uses(@Nonnull SoftwareSystem destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle)Adds a unidirectional "uses" style relationship between this element and a software system.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "uses", "gets data from", "sends data to")technology
- the technology details (e.g. JSON/HTTPS)interactionStyle
- the interaction style (sync vs async)- Returns:
- the relationship that has just been created and added to the model
-
uses
Adds a unidirectional "uses" style relationship between this element and container.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "uses", "gets data from", "sends data to")- Returns:
- the relationship that has just been created and added to the model
-
uses
@Nullable public Relationship uses(@Nonnull Container destination, java.lang.String description, java.lang.String technology)Adds a unidirectional "uses" style relationship between this element and a container.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "uses", "gets data from", "sends data to")technology
- the technology details (e.g. JSON/HTTPS)- Returns:
- the relationship that has just been created and added to the model
-
uses
@Nullable public Relationship uses(@Nonnull Container destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle)Adds a unidirectional "uses" style relationship between this element and a container.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "uses", "gets data from", "sends data to")technology
- the technology details (e.g. JSON/HTTPS)interactionStyle
- the interaction style (sync vs async)- Returns:
- the relationship that has just been created and added to the model
-
uses
Adds a unidirectional "uses" style relationship between this element and component.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "uses", "gets data from", "sends data to")- Returns:
- the relationship that has just been created and added to the model
-
uses
@Nullable public Relationship uses(@Nonnull Component destination, java.lang.String description, java.lang.String technology)Adds a unidirectional "uses" style relationship between this element and a component.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "uses", "gets data from", "sends data to")technology
- the technology details (e.g. JSON/HTTPS)- Returns:
- the relationship that has just been created and added to the model
-
uses
@Nullable public Relationship uses(@Nonnull Component destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle)Adds a unidirectional "uses" style relationship between this element and a component.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "uses", "gets data from", "sends data to")technology
- the technology details (e.g. JSON/HTTPS)interactionStyle
- the interaction style (sync vs async)- Returns:
- the relationship that has just been created and added to the model
-
delivers
Adds a unidirectional relationship between this element and a person.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "sends e-mail to")- Returns:
- the relationship that has just been created and added to the model
-
delivers
@Nullable public Relationship delivers(@Nonnull Person destination, java.lang.String description, java.lang.String technology)Adds a unidirectional relationship between this element and a person.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "sends e-mail to")technology
- the technology details (e.g. JSON/HTTPS)- Returns:
- the relationship that has just been created and added to the model
-
delivers
@Nullable public Relationship delivers(@Nonnull Person destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle)Adds a unidirectional relationship between this element and a person.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "sends e-mail to")technology
- the technology details (e.g. JSON/HTTPS)interactionStyle
- the interaction style (sync vs async)- Returns:
- the relationship that has just been created and added to the model
-
uses
@Nullable public Relationship uses(@Nonnull StaticStructureElement destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle)Adds a unidirectional "uses" style relationship between this element and the specified element.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "uses", "gets data from", "sends data to")technology
- the technology details (e.g. JSON/HTTPS)interactionStyle
- the interaction style (sync vs async)- Returns:
- the relationship that has just been created and added to the model
-
getRequiredTags
protected abstract java.util.Set<java.lang.String> getRequiredTags() -
getId
public java.lang.String getId()Gets the ID of this item in the model.- Returns:
- the ID, as a String
-
getOriginId
public java.lang.String getOriginId() -
getTags
public java.lang.String getTags()Gets the comma separated list of tags.- Returns:
- a comma separated list of tags, or an empty string if there are no tags
-
getTagsAsSet
public java.util.Set<java.lang.String> getTagsAsSet() -
addTags
public void addTags(java.lang.String... tags) -
removeTag
public boolean removeTag(java.lang.String tag)Removes the given tag.- Parameters:
tag
- the tag to remove- Returns:
- true if the tag was removed; will return false if a non-existent tag is passed, or if an attempt is made to remove required tags, which cannot be removed.
-
hasTag
public boolean hasTag(java.lang.String tag)Determines whether this model item has the given tag.- Parameters:
tag
- the tag to check for- Returns:
- true if tag is present as a tag on this item, or if it is one of the required tags defined by the model in getRequiredTags(), false otherwise
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()Gets the collection of name-value property pairs associated with this element, as a Map.- Returns:
- a Map (String, String) (empty if there are no properties)
-
addProperty
public void addProperty(java.lang.String name, java.lang.String value)Adds a name-value pair property to this element.- Parameters:
name
- the name of the propertyvalue
- the value of the property
-
getPerspectives
Gets the set of perspectives associated with this model item.- Returns:
- a Set of Perspective objects (empty if there are none)
-
addPerspective
Adds a perspective to this model item.- Parameters:
name
- the name of the perspective (e.g. "Security", must be unique)description
- a description of the perspective- Returns:
- a Perspective object
- Throws:
java.lang.IllegalArgumentException
- if perspective details are not specified, or the named perspective exists already
-