Created a new class for character/char tests, PrimitiveCharacterTest. This is the start of breaking down PrimitiveTest into smaller chunks.
When MiniGson can not find a type adapter for a type, revised the message to say can't handle instead of can't serialize.
Got rid of default Hierarchy Serializer/Deserializers from DefaultTypeAdapters.
Got rid of methods for gettting default serializers/deserializers/instance creators. Instead we reuse the static final instances.
Fixed warnings in TypeAdapters where a parameterized type T was hiding the parameterized T in methods.
Removed support to unwrap single element array of enums into enum values. Also removed the test that verifies this behavior.
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.
First preference: a type adapter registered for the runtime type
Second preference: a type adapter registered for the declared type
Third preference: reflective type adapter for the runtime type (if it is a sub class of the declared type)
Fourth preference: reflective type adapter for the declared type
If a type adapter is registered for a base class, then a field of that type is serialized with the type adapter instead of using the run-time type.
This fixes: CustomSerializerTest.testBaseClassSerializerInvokedForBaseClassFieldsHoldingSubClassInstances