Class AdrToolsDecisionImporter
- java.lang.Object
-
- com.structurizr.documentation.importer.AdrToolsDecisionImporter
-
- All Implemented Interfaces:
DocumentationImporter
public class AdrToolsDecisionImporter extends java.lang.Object implements 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 Constructor Description AdrToolsDecisionImporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringcalculateUrl(com.structurizr.documentation.Decision decision)protected java.util.DateextractDate(java.lang.String[] lines)protected java.lang.StringextractIntegerIDFromFileName(java.io.File file)protected voidextractLinks(com.structurizr.documentation.Decision decision, java.util.Map<java.lang.String,com.structurizr.documentation.Decision> decisionsByFilename)protected java.lang.StringextractStatus(java.lang.String[] lines)protected java.lang.StringextractTitle(java.lang.String[] lines)protected com.structurizr.documentation.DecisionimportDecision(java.io.File file)voidimportDocumentation(com.structurizr.documentation.Documentable documentable, java.io.File path)Imports Markdown files from the specified path, one per decision.voidsetDateFormat(java.lang.String dateFormat)Sets the date format to use when parsing dates (the default is "yyyy-MM-dd").voidsetTimeZone(java.lang.String timeZone)Sets the time zone to use when parsing dates (the default is UTC)voidsetTimeZone(java.util.TimeZone timeZone)Sets the time zone to use when parsing dates.protected java.lang.StringurlEncode(java.lang.String value)
-
-
-
Method Detail
-
setDateFormat
public void setDateFormat(java.lang.String dateFormat)
Sets the date format to use when parsing dates (the default is "yyyy-MM-dd").- Parameters:
dateFormat- a date format, as a String
-
setTimeZone
public void setTimeZone(java.lang.String timeZone)
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
public void setTimeZone(java.util.TimeZone timeZone)
Sets the time zone to use when parsing dates.- Parameters:
timeZone- a TimeZone instance
-
importDocumentation
public void importDocumentation(com.structurizr.documentation.Documentable documentable, java.io.File path)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
protected com.structurizr.documentation.Decision importDecision(java.io.File file) throws java.lang.Exception- Throws:
java.lang.Exception
-
extractIntegerIDFromFileName
protected java.lang.String extractIntegerIDFromFileName(java.io.File file)
-
extractTitle
protected java.lang.String extractTitle(java.lang.String[] lines)
-
extractDate
protected java.util.Date extractDate(java.lang.String[] lines) throws java.lang.Exception- Throws:
java.lang.Exception
-
extractStatus
protected java.lang.String extractStatus(java.lang.String[] lines)
-
extractLinks
protected void extractLinks(com.structurizr.documentation.Decision decision, java.util.Map<java.lang.String,com.structurizr.documentation.Decision> decisionsByFilename)
-
calculateUrl
protected java.lang.String calculateUrl(com.structurizr.documentation.Decision decision) throws java.lang.Exception- Throws:
java.lang.Exception
-
urlEncode
protected java.lang.String urlEncode(java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
-