Gson v1.4 Release Notes

  • 2009_10_09

    • JsonStreamParser: A streaming parser API class to deserialize multiple JSON objects on a stream (such as a pipelined HTTP response)
    • Raised the deserialization limit for byte and object arrays and collection to over 11MB from 80KB. See issue 96.
    • While serializing, Gson now uses the actual type of a field. This allows serialization of base-class references holding sub-classes to the JSON for the sub-class. It also allows serialization of raw collections. See Issue 155, 156.
    • Added a Gson.toJsonTree() method that serializes a Java object to a tree of JsonElements. See issue 110.
    • Added a Gson.fromJson(JsonElement) method that deserializes from a Json parse tree.
    • Updated Expose annotation to contain parameters serialize and deserialize to control whether a field gets serialized or deserialized. See issue 146.
    • Added a new naming policy LOWER_CASE_WITH_DASHES
    • Default date type adapter is now thread-safe. See Issue 162.
    • JsonElement.toString() now outputs valid JSON after escaping characters properly. See issue 154.
    • JsonPrimitive.equals() now returns true for two numbers if their values are equal. All integral types (long, int, short, byte, BigDecimal, Long, Integer, Short, Byte) are treated equivalent for comparison. Similarly, floating point types (double, float, BigDecimal, Double, Float) are treated equivalent as well. See issue 147.
    • Fixed bugs in pretty printing. See issue 153.
    • If a field causes circular reference error, Gson lists the field name instead of the object value. See issue 118.
    • Gson now serializes a list with null elements correctly. See issue 117.
    • Fixed issue 121, 123, 126.
    • Support user defined exclusion strategies (Feature Request 138).