Commit Graph

17 Commits

Author SHA1 Message Date
Inderjeet Singh
8aedbc84db Added a new GsonBuilder option to register a type adapter for a type hierarchy instead of a single type.
Upgraded Gson version to 1.5 since a new API call is being added.
2010-06-21 23:26:06 +00:00
Joel Leitch
8297437610 Reverting r499. 2009-09-23 19:25:50 +00:00
Joel Leitch
c6f762f36b Fix Warnings 2009-09-23 19:09:01 +00:00
Inderjeet Singh
3b0f8f4340 Removed all the JDK warnings about unused fields in test classes or unused constructors for use by Gson or instanceof calls on parameterized types. 2009-09-23 17:45:16 +00:00
Joel Leitch
18b301dfeb - Serializing of Object arrays.
- Fixed incorrect warning
2009-09-22 19:04:27 +00:00
Inderjeet Singh
82771f006c removed Java 1.5 warnings 2009-08-31 17:51:47 +00:00
Inderjeet Singh
1c5785be57 Tests to reproduce issue 95. The tests currently pass so the bug will be marked as invalid. 2009-03-12 20:54:00 +00:00
Inderjeet Singh
da8a1feee8 Added tests for the bugreport http://code.google.com/p/google-gson/issues/detail?id=99 2009-03-03 21:09:07 +00:00
Joel Leitch
02decace26 Added the ability to deserialize a Map "key" object from a String into a complex Java type. 2009-01-06 07:09:19 +00:00
Joel Leitch
fc65667d2f Add support for wildcard type on Maps, Collections and other parameterized types. 2008-12-14 07:12:04 +00:00
Joel Leitch
b90228dcc0 Enable serialization of nulls within Maps. 2008-11-30 23:01:14 +00:00
Joel Leitch
b6f767bf05 Fix warning in code 2008-11-15 05:13:05 +00:00
Inderjeet Singh
9a69560d9f During serialization, we now dont call custom serializers the field is null.
During deserialization, we do not call custom deserializer if the field is to be set to null. Moreover, changed the logic to set fields to null only if explicitly indicated in the incoming Json. This is different from past behavior where all fields not mentioned in incoming Json were set to null. Now they are set to whatever the default constructor will do.
2008-11-14 20:52:57 +00:00
Inderjeet Singh
bc2c25f235 Removed ExceptionWrapper from serializers.
This is done since it is improper to throw a parse exception from serializers. Moreover, the serializers dont deal with external input, they deal with classes, so they need not guard against spurious input.
2008-11-14 02:17:19 +00:00
Inderjeet Singh
9245bebdba For the Collection and Map types, using ObjectConstructor to create instance instead of hard-coding a specific type.
This helps is handling cases where the user is using their own subclass of Collection or Map.

Updated ParameterizedTypeHandlerMap to return the handler corresponding to Map and Collection for subclasses if user has not specified a specific handler.

Fixed the logic in JsonTreeNavigator to not output a comma if the first field of an object was null.
2008-11-14 02:11:46 +00:00
Inderjeet Singh
eaa43b76e4 Added a custom type adapter for Collection class. We will migrate the code to use it instead of special cases for collections all over. This type adapter is called at a few places already.
Also added tests for verifying that Gson can handle serialization and deserialization of sub types of Maps. The deserialization test fails currently.
2008-11-13 23:40:10 +00:00
Inderjeet Singh
3cd665b199 Added support for serialization of raw maps.
Also, refactored tests for maps in MapTest class.
2008-10-21 22:37:41 +00:00