Class DiagramBuilder


  • public class DiagramBuilder
    extends Object
    • Constructor Detail

      • DiagramBuilder

        public DiagramBuilder()
    • Method Detail

      • parseJson

        public static Diagram parseJson​(String json)
                                 throws org.json.JSONException
        Throws:
        org.json.JSONException
      • parseJson

        public static Diagram parseJson​(String json,
                                        Boolean keepGlossaryLink)
                                 throws org.json.JSONException
        Parse the json string to the diagram model, assumes that the json is hierarchical ordered
        Parameters:
        json -
        Returns:
        Model with all shapes defined in JSON
        Throws:
        org.json.JSONException
      • parseJson

        public static Diagram parseJson​(org.json.JSONObject json)
                                 throws org.json.JSONException
        Throws:
        org.json.JSONException
      • parseJson

        public static Diagram parseJson​(org.json.JSONObject json,
                                        Boolean keepGlossaryLink)
                                 throws org.json.JSONException
        do the parsing on an JSONObject, assumes that the json is hierarchical ordered, so all shapes are reachable over child relations
        Parameters:
        json - hierarchical JSON object
        Returns:
        Model with all shapes defined in JSON
        Throws:
        org.json.JSONException
      • flatRessources

        public static HashMap<String,​org.json.JSONObject> flatRessources​(org.json.JSONObject object)
                                                                        throws org.json.JSONException
        Prepare a model JSON for analyze, resolves the hierarchical structure creates a HashMap which contains all resourceIds as keys and for each key the JSONObject, all id are keys of this map
        Parameters:
        object -
        Returns:
        a HashMap keys: all ressourceIds values: all child JSONObjects
        Throws:
        org.json.JSONException