Class StructurizrDslParser

java.lang.Object
com.structurizr.dsl.StructurizrDslParser

public final class StructurizrDslParser extends Object
Main DSL parser class - forms the API for using the parser.
  • Constructor Details

    • StructurizrDslParser

      public StructurizrDslParser()
      Creates a new instance of the parser.
  • Method Details

    • getIdentifierScope

      public IdentifierScope getIdentifierScope()
    • setIdentifierScope

      public void setIdentifierScope(IdentifierScope identifierScope)
    • setRestricted

      public void setRestricted(boolean restricted)
      Sets whether to run this parser in restricted mode (this stops !include, !docs, !adrs from working).
      Parameters:
      restricted - true for restricted mode, false otherwise
    • getWorkspace

      public com.structurizr.Workspace getWorkspace()
      Gets the workspace that has been created by parsing the Structurizr DSL.
      Returns:
      a Workspace instance
    • parse

      public void parse(File path) throws StructurizrDslParserException
      Parses the specified Structurizr DSL file(s), adding the parsed content to the workspace. If "path" represents a single file, that single file will be parsed. If "path" represents a directory, all files in that directory (recursively) will be parsed.
      Parameters:
      path - a File object representing a file or directory
      Throws:
      StructurizrDslParserException - when something goes wrong
    • parse

      public void parse(String dsl) throws StructurizrDslParserException
      Parses the specified Structurizr DSL fragment, adding the parsed content to the workspace.
      Parameters:
      dsl - a DSL fragment
      Throws:
      StructurizrDslParserException - when something goes wrong
    • getIdentifiersRegister

      public IdentifiersRegister getIdentifiersRegister()
      Gets the identifier register in use (this is the mapping of DSL identifiers to elements/relationships).
      Returns:
      an IdentifiersRegister object