Class JsonTree

    • Field Detail

      • m_JSON

        protected net.minidev.json.JSONAware m_JSON
        the underlying JSON object.
      • m_SortKeys

        protected boolean m_SortKeys
        whether to sort the keys of a JSONObject.
    • Constructor Detail

      • JsonTree

        public JsonTree()
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class BaseTree
      • buildTree

        protected void buildTree​(JsonNode parent,
                                 net.minidev.json.JSONObject obj)
        Builds the tree.
        Parameters:
        parent - the current parent, null for root
        obj - the JSON object to process
      • buildTree

        protected void buildTree​(JsonNode parent,
                                 net.minidev.json.JSONArray obj)
        Builds the tree.
        Parameters:
        parent - the current parent, null for root
        obj - the JSON array to process
      • buildTree

        protected JsonNode buildTree​(JsonNode parent,
                                     Object obj)
        Builds the tree.
        Parameters:
        parent - the current parent, null for root
        obj - the object to attach
        Returns:
        the generated node
      • buildTree

        protected void buildTree()
        Builds the tree from the current JSON object.
      • showNodePopupMenu

        protected void showNodePopupMenu​(MouseEvent e)
        Shows a popup if possible for the given mouse event.
        Parameters:
        e - the event
      • setJSON

        public void setJSON​(net.minidev.json.JSONAware value)
        Sets the JSON object to display.
        Specified by:
        setJSON in interface JsonSupporter
        Parameters:
        value - the JSON object to display
      • getJSON

        public net.minidev.json.JSONAware getJSON()
        Returns the JSON object on display.
        Specified by:
        getJSON in interface JsonSupporter
        Returns:
        the JSON object, null if none displayed
      • setSortKeys

        public void setSortKeys​(boolean value)
        Sets whether to sort the keys of JSONObject objects. Triggers a re-build of the tree.
        Parameters:
        value - true if to sort the keys
      • getSortKeys

        public boolean getSortKeys()
        Returns whether the keys of JSONObject objects are sorted.
        Returns:
        true if keys get sorted