@Override public void deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException { Object oldValue = _accessor.getValue(instance); Object newValue; // 20-Oct-2016, tatu: Couple of possibilities of how to proceed; for // now, default to "normal" handling without merging if (oldValue == null) { newValue = delegate.deserialize(p, ctxt); } else { newValue = delegate.deserializeWith(p, ctxt, oldValue); } if (newValue != oldValue) { // 18-Apr-2017, tatu: Null handling should occur within delegate, which may // set/skip/transform it, or throw an exception. delegate.set(instance, newValue); } }
@Override public Object deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException { Object oldValue = _accessor.getValue(instance); Object newValue; // 20-Oct-2016, tatu: Couple of possibilities of how to proceed; for // now, default to "normal" handling without merging if (oldValue == null) { newValue = delegate.deserialize(p, ctxt); } else { newValue = delegate.deserializeWith(p, ctxt, oldValue); } // 23-Oct-2016, tatu: One possible complication here; should we always // try calling setter on builder? Presumably should not be required, // but may need to revise if (newValue != oldValue) { // 31-Oct-2016, tatu: Basically should just ignore as null can't really // contribute to merging. if (newValue != null) { return delegate.setAndReturn(instance, newValue); } } return instance; }
@Override public void deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException { Object oldValue = _accessor.getValue(instance); Object newValue; // 20-Oct-2016, tatu: Couple of possibilities of how to proceed; for // now, default to "normal" handling without merging if (oldValue == null) { newValue = delegate.deserialize(p, ctxt); } else { newValue = delegate.deserializeWith(p, ctxt, oldValue); } if (newValue != oldValue) { // 18-Apr-2017, tatu: Null handling should occur within delegate, which may // set/skip/transform it, or throw an exception. delegate.set(instance, newValue); } }
@Override public Object deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException { Object oldValue = _accessor.getValue(instance); Object newValue; // 20-Oct-2016, tatu: Couple of possibilities of how to proceed; for // now, default to "normal" handling without merging if (oldValue == null) { newValue = delegate.deserialize(p, ctxt); } else { newValue = delegate.deserializeWith(p, ctxt, oldValue); } // 23-Oct-2016, tatu: One possible complication here; should we always // try calling setter on builder? Presumably should not be required, // but may need to revise if (newValue != oldValue) { // 31-Oct-2016, tatu: Basically should just ignore as null can't really // contribute to merging. if (newValue != null) { return delegate.setAndReturn(instance, newValue); } } return instance; }