public JsonElement serialize()

in src/org/jetbrains/plugins/ipnb/format/IpnbParser.java [772:837]


    public JsonElement serialize(CellOutputRaw cellRaw, Type typeOfSrc, JsonSerializationContext context) {
      final JsonObject jsonObject = new JsonObject();
      if (cellRaw.ename != null) {
        jsonObject.addProperty("ename", cellRaw.ename);
      }
      if (cellRaw.name != null) {
        jsonObject.addProperty("name", cellRaw.name);
      }
      if (cellRaw.evalue != null) {
        jsonObject.addProperty("evalue", cellRaw.evalue);
      }

      if (cellRaw.data != null) {
        final JsonElement data = gson.toJsonTree(cellRaw.data);
        jsonObject.add("data", data);
      }
      if (cellRaw.execution_count != null) {
        jsonObject.addProperty("execution_count", cellRaw.execution_count);
      }
      if (cellRaw.png != null) {
        jsonObject.addProperty("png", cellRaw.png);
      }

      if (cellRaw.stream != null) {
        jsonObject.addProperty("stream", cellRaw.stream);
      }

      if (cellRaw.jpeg != null) {
        jsonObject.addProperty("jpeg", cellRaw.jpeg);
      }

      if (cellRaw.html != null) {
        final JsonElement html = gson.toJsonTree(cellRaw.html);
        jsonObject.add("html", html);
      }
      if (cellRaw.latex != null) {
        final JsonElement latex = gson.toJsonTree(cellRaw.latex);
        jsonObject.add("latex", latex);
      }

      if (cellRaw.svg != null) {
        final JsonElement svg = gson.toJsonTree(cellRaw.svg);
        jsonObject.add("svg", svg);
      }
      if (cellRaw.prompt_number != null) {
        jsonObject.addProperty("prompt_number", cellRaw.prompt_number);
      }
      if (cellRaw.traceback != null) {
        final JsonElement traceback = gson.toJsonTree(cellRaw.traceback);
        jsonObject.add("traceback", traceback);
      }

      if (cellRaw.metadata != null) {
        final JsonElement metadata = gson.toJsonTree(cellRaw.metadata);
        jsonObject.add("metadata", metadata);
      }
      if (cellRaw.output_type != null) {
        jsonObject.addProperty("output_type", cellRaw.output_type);
      }
      if (cellRaw.text != null) {
        final JsonElement text = gson.toJsonTree(cellRaw.text);
        jsonObject.add("text", text);
      }

      return jsonObject;
    }