code: public JSONObject toJson() throws JSONException {
  
          JSONObject result = new JSONObject();
          if (m_detailId != null) {
              result.put(JSON_DETAIL, "" + m_detailId);
          }
          if (m_siteRoot != null) {
              result.put(JSON_SITEROOT, m_siteRoot);
          }
          if (m_structureId != null) {
              result.put(JSON_STRUCTUREID, "" + m_structureId);
          }
          if (m_projectId != null) {
              result.put(JSON_PROJECT, "" + m_projectId);
          }
          if (m_type != null) {
              result.put(JSON_TYPE, "" + m_type.getJsonId());
          }
          return result;
      }
docs: Converts this object to JSON.
  
  @return the JSON representation
  
  @throws JSONException if JSON operations fail