Class AdrToolsDecisionImporter

java.lang.Object
com.structurizr.importer.documentation.AdrToolsDecisionImporter
All Implemented Interfaces:
DocumentationImporter

public class AdrToolsDecisionImporter extends 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 Details

    • AdrToolsDecisionImporter

      public AdrToolsDecisionImporter()
  • Method Details

    • setDateFormat

      public void setDateFormat(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(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(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, File path)
      Imports Markdown files from the specified path, one per decision.
      Specified by:
      importDocumentation in interface DocumentationImporter
      Parameters:
      documentable - the item that documentation should be associated with
      path - the path to import documentation from
    • importDecision

      protected com.structurizr.documentation.Decision importDecision(File file) throws Exception
      Throws:
      Exception
    • extractIntegerIDFromFileName

      protected String extractIntegerIDFromFileName(File file)
    • extractTitle

      protected String extractTitle(String[] lines)
    • extractDate

      protected Date extractDate(String[] lines) throws Exception
      Throws:
      Exception
    • extractStatus

      protected String extractStatus(String[] lines)
    • extractLinks

      protected void extractLinks(com.structurizr.documentation.Decision decision, Map<String,com.structurizr.documentation.Decision> decisionsByFilename)
    • calculateUrl

      protected String calculateUrl(com.structurizr.documentation.Decision decision) throws Exception
      Throws:
      Exception
    • urlEncode

      protected String urlEncode(String value) throws Exception
      Throws:
      Exception