protected SettableBeanProperty( PropertyName propName, JavaType type, PropertyName wrapper, TypeDeserializer typeDeser, Annotations contextAnnotations, PropertyMetadata metadata) { // 09-Jan-2009, tatu: Intern()ing makes sense since Jackson parsed // field names are (usually) interned too, hence lookups will be faster. // 23-Oct-2009, tatu: should this be disabled wrt [JACKSON-180]? // Probably need not, given that namespace of field/method names // is not unbounded, unlike potential JSON names. if (propName == null) { _propName = PropertyName.NO_NAME; } else { _propName = propName.internSimpleName(); } _type = type; _wrapperName = wrapper; _metadata = metadata; _contextAnnotations = contextAnnotations; _viewMatcher = null; _nullProvider = null; // 30-Jan-2012, tatu: Important: contextualize TypeDeserializer now... if (typeDeser != null) { typeDeser = typeDeser.forProperty(this); } _valueTypeDeserializer = typeDeser; _valueDeserializer = MISSING_VALUE_DESERIALIZER; }
/** Method for finding a deserializer for root-level value. */ @SuppressWarnings("unchecked") public final JsonDeserializer<Object> findRootValueDeserializer(JavaType type) throws JsonMappingException { JsonDeserializer<Object> deser = _cache.findValueDeserializer(this, _factory, type); if (deser == null) { // can this occur? return null; } if (deser instanceof ContextualDeserializer) { deser = (JsonDeserializer<Object>) ((ContextualDeserializer) deser).createContextual(this, null); } TypeDeserializer typeDeser = _factory.findTypeDeserializer(_config, type); if (typeDeser != null) { // important: contextualize to indicate this is for root value typeDeser = typeDeser.forProperty(null); return new TypeWrappedDeserializer(typeDeser, deser); } return deser; }
/** * Method called to finalize setup of this deserializer, when it is known for which property * deserializer is needed for. */ @Override public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) throws JsonMappingException { // note: instead of finding key deserializer, with enums we actually // work with regular deserializers (less code duplication; but not // quite as clean as it ought to be) KeyDeserializer kd = _keyDeserializer; if (kd == null) { kd = ctxt.findKeyDeserializer(_mapType.getKeyType(), property); } JsonDeserializer<?> vd = _valueDeserializer; final JavaType vt = _mapType.getContentType(); if (vd == null) { vd = ctxt.findContextualValueDeserializer(vt, property); } else { // if directly assigned, probably not yet contextual, so: vd = ctxt.handleSecondaryContextualization(vd, property, vt); } TypeDeserializer vtd = _valueTypeDeserializer; if (vtd != null) { vtd = vtd.forProperty(property); } return withResolved(kd, vd, vtd); }