Class AdrToolsDecisionImporter
java.lang.Object
com.structurizr.importer.documentation.AdrToolsDecisionImporter
- All Implemented Interfaces:
DocumentationImporter
Imports architecture decision records created/managed by adr-tools (https://github.com/npryce/adr-tools).
The format for ADRs is as follows:
Filename: {DECISION_ID:0000}-*.md
Content:
# {DECISION_ID}. {DECISION_TITLE}
Date: {DECISION_DATE:YYYY-MM-DD}
## Status
{DECISION_STATUS and links}
## Context
...
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcalculateUrl(com.structurizr.documentation.Decision decision) protected DateextractDate(String[] lines) protected Stringprotected voidextractLinks(com.structurizr.documentation.Decision decision, Map<String, com.structurizr.documentation.Decision> decisionsByFilename) protected StringextractStatus(String[] lines) protected StringextractTitle(String[] lines) protected com.structurizr.documentation.DecisionimportDecision(File file) voidimportDocumentation(com.structurizr.documentation.Documentable documentable, File path) Imports Markdown files from the specified path, one per decision.voidsetDateFormat(String dateFormat) Sets the date format to use when parsing dates (the default is "yyyy-MM-dd").voidsetTimeZone(String timeZone) Sets the time zone to use when parsing dates (the default is UTC)voidsetTimeZone(TimeZone timeZone) Sets the time zone to use when parsing dates.protected String
-
Constructor Details
-
AdrToolsDecisionImporter
public AdrToolsDecisionImporter()
-
-
Method Details
-
setDateFormat
Sets the date format to use when parsing dates (the default is "yyyy-MM-dd").- Parameters:
dateFormat- a date format, as a String
-
setTimeZone
Sets the time zone to use when parsing dates (the default is UTC)- Parameters:
timeZone- a time zone as a String (e.g. "Europe/London" or "UTC")
-
setTimeZone
Sets the time zone to use when parsing dates.- Parameters:
timeZone- a TimeZone instance
-
importDocumentation
Imports Markdown files from the specified path, one per decision.- Specified by:
importDocumentationin interfaceDocumentationImporter- Parameters:
documentable- the item that documentation should be associated withpath- the path to import documentation from
-
importDecision
- Throws:
Exception
-
extractIntegerIDFromFileName
-
extractTitle
-
extractDate
- Throws:
Exception
-
extractStatus
-
extractLinks
-
calculateUrl
- Throws:
Exception
-
urlEncode
- Throws:
Exception
-