Class JsonReader

java.lang.Object
com.structurizr.io.json.JsonReader
All Implemented Interfaces:
WorkspaceReader

public final class JsonReader extends Object implements WorkspaceReader
Reads a workspace definition as JSON.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.structurizr.Workspace
    read(Reader reader)
    Reads and parses a workspace definition from a JSON document.
    void
    setIdGenerator(com.structurizr.model.IdGenerator idGenerator)
    Sets the ID generator to use when parsing a JSON workspace definition.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JsonReader

      public JsonReader()
  • Method Details

    • setIdGenerator

      public void setIdGenerator(com.structurizr.model.IdGenerator idGenerator)
      Sets the ID generator to use when parsing a JSON workspace definition.
      Parameters:
      idGenerator - an IdGenerator implementation
    • read

      public com.structurizr.Workspace read(Reader reader) throws WorkspaceReaderException
      Reads and parses a workspace definition from a JSON document.
      Specified by:
      read in interface WorkspaceReader
      Parameters:
      reader - a Reader on top of the workspace definition
      Returns:
      a Workspace object
      Throws:
      WorkspaceReaderException - if something goes wrong