1package com.fasterxml.jackson.databind.deser.impl;
2
3import java.io.IOException;
4import java.lang.annotation.Annotation;
5
6import com.fasterxml.jackson.core.JsonParser;
7import com.fasterxml.jackson.databind.*;
8import com.fasterxml.jackson.databind.deser.*;
9import com.fasterxml.jackson.databind.introspect.AnnotatedMember;
10
11/**
12 * Specialized {@link SettableBeanProperty} implementation used
13 * for virtual property that represents Object Id that is used
…lines 14–71 unchanged (58 lines)
72 }
73
74 @Override
75 public Object deserializeSetAndReturn(JsonParser p,
76 DeserializationContext ctxt, Object instance) throws IOException
77 {
78 Object id = _valueDeserializer.deserialize(p, ctxt);
79 /* 02-Apr-2015, tatu: Actually, as per [databind#742], let it be;
80 * missing or null id is needed for some cases, such as cases where id
81 * will be generated externally, at a later point, and is not available
82 * quite yet. Typical use case is with DB inserts.
83 */
84 // note: no null checks (unlike usually); deserializer should fail if one found
85 if (id == null) {
86 return null;
87 }
88 ReadableObjectId roid = ctxt.findObjectId(id, _objectIdReader.generator, _objectIdReader.resolver);
89 roid.bindItem(instance);
90 // also: may need to set a property value as well
91 SettableBeanProperty idProp = _objectIdReader.idProperty;
…lines 92–114 unchanged (23 lines)