Commit Graph

9 Commits

Author SHA1 Message Date
Johannes Frohnmeyer dc4e61ac7b
Several breaking changes 2022-05-17 21:20:10 +02:00
Marcono1234 4dda4ec5ba
Use diamond operator when creating generic instances (#2104) 2022-04-17 15:27:21 -07:00
Degubi 7845c38077 Minor cleanups in deprecations and other warnings (#1522) 2019-10-03 15:49:24 -07:00
Jesse Wilson a98d6eae47 Fix the map type adapter to support array serialization natively. 2011-09-12 05:51:17 +00:00
Jesse Wilson 25c6ae177b Down to 22 failing tests.
Consolidated all of the different code paths that we use to construct instances. We now have an ObjectConstructor class that knows what type it constructs; this means that we don't need to ever do reflection to lookup a constructor at construction time.

Cleaned up some buggy type adapters, particularly around handling of null.

Removed dead code for object graph navigation.

Moved some classes into 'internal' so they are visible to the 'bind' subpackage.

Turned some TypeAdapterFactory/TypeAdapter pairs inside out so that the TypeAdapter is now the inner class. This is necessary so that the factories can take parameters.

Added an API to request the 'next' type adapter for a type. This allows type adapters to compose other type adapters. We're using this in two places:
 - where the user has excluded a type from serialization but not deserialization, we need to use the "default" deserialization but interpose null on serialization. We create a type adapter that delegates for one and returns null for the other.
 - similarly when a DOM type serializer is registered but no deserializer, or vice versa.
This is the biggest change to the MiniGson core.

For backwards compatibility, return null for the empty string.

Simplify JsonSerializationContext/JsonDeserializationContext to simply call through to GSON. SerializeDefault is currently unsupported.

More useful error messages when calling getAsBoolean on a JsonNull.

Remove currently unused MemoryRefStack. We might need this back again, though wiring it back in will be much more difficult because we don't interject ourselves between the users' various type adapters.
2011-09-11 07:04:56 +00:00
Inderjeet Singh 60e7c481fd Added complex map serialization tests in case the Map is defined with TypeVariables. 2011-05-30 09:38:38 +00:00
Joel Leitch a9507250f9 Add test for multiple calls to register complex map key serialization. 2011-03-15 15:41:19 +00:00
Joel Leitch e57ef0908b Add method to GsonBuilder to enable complex key serialization of maps. 2011-03-15 15:37:41 +00:00
Jesse Wilson 37dc0f8d3e Type adapter for maps. Supports both complex and non-complex keys. 2011-01-12 00:17:21 +00:00