Class JsonReader

  • All Implemented Interfaces:
    WorkspaceReader

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

      Constructors 
      Constructor Description
      JsonReader()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.structurizr.Workspace read​(java.io.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 Detail

      • JsonReader

        public JsonReader()
    • Method Detail

      • 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​(java.io.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