Commit Graph

10 Commits

Author SHA1 Message Date
Maicol
2c94c757a6
Formats codebase (#2531)
* Formats `.java` files

* Formats `.md` files
2023-11-06 11:59:01 -08:00
Jesse Wilson
de835d4dcd Roll back JsonSerializationContext and JsonDeserializationContext to their 1.7.2 API. 2011-10-01 00:58:25 +00:00
Jesse Wilson
2236c95c37 Death to serializeDefault and deserializeDefault 2011-09-28 18:00:34 +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
566c27cf21 Adapted legacy Gson adapters into mini Gson. 2011-08-03 02:17:42 +00:00
Inderjeet Singh
62675b7f46 Added serializeDefault and deserializeDefault methods in contexts that only invoke system type adapters on the top-level object.
With this, the RuntimeTypeAdapterTest passes.
2011-07-01 21:29:20 +00:00
Inderjeet Singh
e79bcde8bf Using JsonNull.INSTANCE instead of JsonNull.createJsonNull() method 2011-05-25 16:55:57 +00:00
Joel Leitch
572421b771 Open object construction in JsonDeserializationContext to leverage the same object construction as default gson deserialization. 2011-05-20 21:50:39 +00:00
Inderjeet Singh
149604f0be Made author tags consistent across the public api. 2009-04-01 17:03:31 +00:00
Inderjeet Singh
57d1f32de5 moved gson as a project under trunk 2008-09-01 03:13:32 +00:00