-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Description
Hi, guys!
I was thinking of the problem and have concluded, that the solution of the
issue (see link
http://groups.google.com/group/google-gson/t/677d56e9976d7761):
JsonObjectDeserializationVisitor should check if there is custom
deserializer registered for specified type and not create instance by.
Something like this:
@SuppressWarnings("unchecked")
JsonObjectDeserializationVisitor(JsonElement json, Type type,
ObjectNavigatorFactory factory, ObjectConstructor objectConstructor,
TypeAdapter typeAdapter,
ParameterizedTypeHandlerMap<JsonDeserializer<?>> deserializers,
JsonDeserializationContext context) {
super(json, factory, objectConstructor, typeAdapter, deserializers,
context);
JsonDeserializer deserialezer;
if ((deserialezer = deserializers.getHandlerFor(type)) != null) {
this.target = deserialezer.deserialize(json, type, context);
} else {
this.target = (T) objectConstructor.construct(type);
}
}
Original issue reported on code.google.com by [email protected]
on 27 Aug 2008 at 7:57