is the any way to customly deserialize nested data into existed nested
objects?
from documentation
ObjectMapper.readerForUpdating - Deserialization occurs normally except
that the root-level value in JSON is not used for instantiating a new
object; instead give updateable object is used as root.
how to make this happen for each and everyone nested object, not just the
root element?
the main reason - I want in my custom deserializer called method "T
deserialize(JsonParser p, DeserializationContext ctxt, T intoValue)", not
"T deserialize(JsonParser p, DeserializationContext ctxt)"
example usecase
class A {
private B b;
}
class B {
private String value;
}
module.addDeserializer(B.class, new BDeserializer());
mapper.readerForUpdating(a).readValue({a: {b:{value:1}}})
class BDeserializer extends StdDeserializer<B> {
public B deserialize(JsonParser p, DeserializationContext ctxt, B
existedValue) throws IOException, JsonProcessingException {
// do thms vith existedValue
return existedValue;
}
}
--
You received this message because you are subscribed to the Google Groups
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.