问题
I believe we need a custom deserializer to do something specific with one field on our class. It appears once I do this, I am now responsible for deserializing all the other fields. Is there a way to have Jackson deserialize all the fields except the one I am concerned with here?
public class ThingDeseralizer extends StdDeserializer<Thing> {
    @Override
    public Thing deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
        ObjectCodec oc = p.getCodec();
        JsonNode node = oc.readTree(p);
        String special = node.get("special").asText();
        Thing thing = new Thing()
        thing.doSomethignWithSpecial(special)
        return thing;
    }
}
Thanx
回答1:
On your field in POJO add @JsonDeserialize(using = ThingDeseralizer.class) annotation.
This will tell Jackson how to deserialze that particular field, rest all will go as default.
来源:https://stackoverflow.com/questions/41001302/jackson-deserializer-for-one-custom-field