discomarathon / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

com.google.gson.Gson should be able to toJson JsonElements/JsonObjects #141

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
com.google.gson.Gson should be able to toJson JsonElements/JsonObjects

Something like this would be stellar:
  public String toJson(JsonElement jsonElement)
  {
      final StringWriter writer = new StringWriter();
      try
      {
        formatter.format(jsonElement, writer, serializeNulls);
      }
      catch (IOException e)
      {
          throw new RuntimeException(e.getMessage(), e);
      }
      return writer.toString();
  }

Original issue reported on code.google.com by james.w....@gmail.com on 7 Aug 2009 at 6:22

GoogleCodeExporter commented 9 years ago
Fixed in r434 by creating new APIs toJson(JsonElement) and toJson(JsonElement,
Appendable)

Original comment by inder123 on 7 Aug 2009 at 8:59

GoogleCodeExporter commented 9 years ago
Hey thanks heaps for that :-)

Original comment by james.w....@gmail.com on 8 Aug 2009 at 3:13

GoogleCodeExporter commented 9 years ago
Hey thanks heaps for that :-)

Original comment by james.w....@gmail.com on 8 Aug 2009 at 3:20