I have a few use cases where JSON deserialization may be deferred, and the user given a chance to override, modify properties, merge with another bean, or otherwise defer deserialization until some later point in runtime. Right now, there doesn't seem to be a feasible way to do this other than to write a weighty JsonDeserializer implementation that detects the value type, constructs the content deserializer, etc.
Instead, it would be wonderful if an annotation allowed for injection of a SubDeserializer<T>, with nothing but:
T deserialize(JsonParser parser) throws IOException
Ability to inject DeserializationContext, in general, sounds like a reasonable feature, even if not trivial to implement. I don't know if other support for deferred deserialization is feasible.
I have a few use cases where JSON deserialization may be deferred, and the user given a chance to override, modify properties, merge with another bean, or otherwise defer deserialization until some later point in runtime. Right now, there doesn't seem to be a feasible way to do this other than to write a weighty
JsonDeserializer
implementation that detects the value type, constructs the content deserializer, etc.Instead, it would be wonderful if an annotation allowed for injection of a
SubDeserializer<T>
, with nothing but:T deserialize(JsonParser parser) throws IOException
SubDeserializer<T> with/without(DeserializationFeature... features)
independently callable at a later time. This allows something like: