Commit Graph

25 Commits

Author SHA1 Message Date
Joel Leitch
861e047a62 Create an "internals" package for classes that we do not want to share, but is needed across multiple pacakges.
As well, move non-Gson specific classes, such as Preconditions, to this new "internals" package.
2011-03-21 22:30:35 +00:00
Joel Leitch
e57ef0908b Add method to GsonBuilder to enable complex key serialization of maps. 2011-03-15 15:37:41 +00:00
Inderjeet Singh
52288d7127 rawtypes -> unchecked
Fixed spurious eclipse warnings on deprecation, missing classes or parameters, etc.
2011-02-24 22:47:55 +00:00
Jesse Wilson
dea7ab89fe Restore pretty printing. The pretty printing format isn't as compact as the previous format - for example arrays of integers are printed one-per-line, whereas the previous format compacted these to all sit on the same line. 2010-11-01 23:03:41 +00:00
Jesse Wilson
4e28bf3a39 Check in a passing test for issue 204. 2010-09-03 06:44:41 +00:00
Jesse Wilson
7e1e4eab07 Remove the constraint that map keys mustn't be the empty string.
See bug 227.
2010-08-28 05:02:33 +00:00
Inderjeet Singh
de0f8da151 replaced unchecked suppressed warnings token with more specific rawtypes.
removed unused imports.
2010-08-20 16:27:46 +00:00
Jesse Wilson
8b5cc3256d Test demonstrating a bug reported in issue 178, wherein malformed JSON is emitted when a map key contains a double-quote. 2010-08-20 05:43:17 +00:00
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