4

The title is not define the problem good so here is the prblem description.

I used a custom deserializer in jackson for my purpose.i need to use the defaul deserializer in my custom deserializer and change some fields in it.i did it based on This approach and here is my method:

public Test deserialize(JsonParser p, DeserializationContext ctxt)
        throws IOException, JsonProcessingException{

    Test test = (Test)this.defaultDeserializer.deserialize(p, ctxt); 

    JsonNode node = p.getCodec().readTree(p);

    // The rest of the code use node to change is some fields.

}

My Problem is when is use default deserializer the node object will be null and i can't use it to fetch other fields from json object. do you have any idea how can i fix this problem?

Community
  • 1
  • 1
Zhozhe
  • 403
  • 2
  • 5
  • 14

0 Answers0