Commit Graph

14 Commits

Author SHA1 Message Date
Joel Leitch
458f2baa2f Added special serialization of "Long". Now the client has the ability to output a long field as a JSON "String". This is useful for JavaScript clients that need to handle long values.
As well, this change does a major clean up of the custom type adapter handling and ParameterizedTypeMap creation.
2008-12-28 03:23:36 +00:00
Inderjeet Singh
bc6ec50db9 incorporated fixes from code review of r341 2008-12-23 18:24:13 +00:00
Inderjeet Singh
51881c7f4a Added a GsonBuilder setting to enable serialization of special double types, NaN, Infinity, and -Infinity. 2008-12-20 01:26:14 +00:00
Inderjeet Singh
362a94ec74 Added deserialization support for Double NaN, Infinity, and -Infinity 2008-12-19 22:21:35 +00:00
Inderjeet Singh
53f7d26b6d removed tests for serialization of BigDecimal NaN, positive and negative infinity since BigDecimal can not be created with these values. 2008-12-19 17:46:24 +00:00
Inderjeet Singh
f7e4d5e4bb Added checks to ensure that we do not serialize NaN or postiive or negative infinity for BigDecimal. 2008-12-18 23:56:38 +00:00
Inderjeet Singh
6dbdb272c0 Added checks to ensure that we do not serialize NaN or postiive or negative infinity for floats. 2008-12-18 23:41:44 +00:00
Inderjeet Singh
cbc6b4d939 Added checks to ensure that we do not serialize NaN or postiive or negative infinity for doubles. 2008-12-18 20:00:27 +00:00
Joel Leitch
d5319d9e84 Parse all JSON numbers as either BigDecimal or BigInteger. From there we can properly convert into the proper primitive type if need be. This reduces the chance of losing precision with floating point numbers. 2008-11-18 20:26:15 +00:00
Joel Leitch
628a2c5b86 Added default serializer/deserializer for "Number" 2008-11-18 20:05:02 +00:00
Joel Leitch
788d2bfbbb Fix parsing of double and big decimals that have an exponent but no fraction part. 2008-11-18 19:55:14 +00:00
Joel Leitch
0d8150fe52 Major restructuring of Primitve type serialization and deserializtion. From the end-user's point of view there should be no difference other than the user can now override the default serialization/deserialization their own custom type adapter (not sure if there is a real use-case out there for this).
This restructuring greatly cleans up the code and reduces some complexity; however, there is more that can be done to clean this up (i.e. get rid of "InstanceCreators" for primitive Type Adapters).
2008-11-15 02:26:57 +00:00
Inderjeet Singh
3b8404dac5 refactored String related functional tests out in a separate test class. 2008-10-10 02:29:06 +00:00
Inderjeet Singh
57d1f32de5 moved gson as a project under trunk 2008-09-01 03:13:32 +00:00