Package com.structurizr.dsl
Class StructurizrDslParser
java.lang.Object
com.structurizr.dsl.StructurizrDslParser
Main DSL parser class - forms the API for using the parser.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the identifier register in use (this is the mapping of DSL identifiers to elements/relationships).com.structurizr.Workspace
Gets the workspace that has been created by parsing the Structurizr DSL.void
Parses the specified Structurizr DSL file(s), adding the parsed content to the workspace.void
Parses the specified Structurizr DSL fragment, adding the parsed content to the workspace.void
setIdentifierScope
(IdentifierScope identifierScope) void
setRestricted
(boolean restricted) Sets whether to run this parser in restricted mode (this stops !include, !docs, !adrs from working).
-
Constructor Details
-
StructurizrDslParser
public StructurizrDslParser()Creates a new instance of the parser.
-
-
Method Details
-
getIdentifierScope
-
setIdentifierScope
-
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
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
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
Gets the identifier register in use (this is the mapping of DSL identifiers to elements/relationships).- Returns:
- an IdentifiersRegister object
-