/** * Alternate build method used when we must be using some form of * abstract resolution, usually by using addition Type Id * ("polymorphic deserialization") * * @since 2.0 */ public AbstractDeserializer buildAbstract() { return new AbstractDeserializer(this, _beanDesc, _backRefProperties, _properties); }
return _deserializeFromObjectId(p, ctxt); return _deserializeFromObjectId(p, ctxt); Object result = _deserializeIfNatural(p, ctxt); if (result != null) { return result;
ctxt.reportBadDefinition(_baseType, String.format( "Invalid Object Id definition for %s: cannot find property with name '%s'", handledType().getName(), propName)); ObjectIdReader oir = ObjectIdReader.construct(idType, objectIdInfo.getPropertyName(), idGen, deser, idProp, resolver); return new AbstractDeserializer(this, oir, null); return new AbstractDeserializer(this, _objectIdReader, null);
throw new IllegalArgumentException("Cannot find a deserializer for non-concrete Map type "+type); deser = AbstractDeserializer.constructForNonPOJO(beanDesc);
isContainer = true; } else if (valueDeser instanceof AbstractDeserializer) { backProp = ((AbstractDeserializer) valueDeser).findBackReference(refName); } else { throw new IllegalArgumentException("Can not handle managed/back reference '"+refName
throw new IllegalArgumentException("Cannot find a deserializer for non-concrete Collection type "+type); deser = AbstractDeserializer.constructForNonPOJO(beanDesc); } else { type = implType;
isContainer = true; } else if (valueDeser instanceof AbstractDeserializer) { backProp = ((AbstractDeserializer) valueDeser).findBackReference(refName); } else { throw new IllegalArgumentException("Can not handle managed/back reference '"+refName
@Override public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException, JsonProcessingException { // Hmmh. One tricky question; for scalar, is it an Object Id, or "Natural" type? // for now, prefer Object Id: if (_objectIdReader != null) { JsonToken t = jp.getCurrentToken(); // should be good enough check; we only care about Strings, integral numbers: if (t != null && t.isScalarValue()) { return _deserializeFromObjectId(jp, ctxt); } } // First: support "natural" values (which are always serialized without type info!) Object result = _deserializeIfNatural(jp, ctxt); if (result != null) { return result; } return typeDeserializer.deserializeTypedFromObject(jp, ctxt); }
/** * Factory method used when constructing instances for non-POJO types, like * {@link java.util.Map}s. * * @since 2.3 */ public static AbstractDeserializer constructForNonPOJO(BeanDescription beanDesc) { return new AbstractDeserializer(beanDesc); }
throw new IllegalArgumentException("Can not find a deserializer for non-concrete Map type "+type); deser = AbstractDeserializer.constructForNonPOJO(beanDesc);
ctxt.reportBadDefinition(_baseType, String.format( "Invalid Object Id definition for %s: cannot find property with name '%s'", handledType().getName(), propName)); ObjectIdReader oir = ObjectIdReader.construct(idType, objectIdInfo.getPropertyName(), idGen, deser, idProp, resolver); return new AbstractDeserializer(this, oir, null); return new AbstractDeserializer(this, _objectIdReader, null);
@Override public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException, JsonProcessingException { // Hmmh. One tricky question; for scalar, is it an Object Id, or "Natural" type? // for now, prefer Object Id: if (_objectIdReader != null) { JsonToken t = jp.getCurrentToken(); // should be good enough check; we only care about Strings, integral numbers: if (t != null && t.isScalarValue()) { return _deserializeFromObjectId(jp, ctxt); } } // First: support "natural" values (which are always serialized without type info!) Object result = _deserializeIfNatural(jp, ctxt); if (result != null) { return result; } return typeDeserializer.deserializeTypedFromObject(jp, ctxt); }
/** * Alternate build method used when we must be using some form of * abstract resolution, usually by using addition Type Id * ("polymorphic deserialization") * * @since 2.0 */ public AbstractDeserializer buildAbstract() { return new AbstractDeserializer(this, _beanDesc, _backRefProperties); }
throw new IllegalArgumentException("Can not find a deserializer for non-concrete Map type "+type); deser = AbstractDeserializer.constructForNonPOJO(beanDesc);
@Override public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException, JsonProcessingException { // Hmmh. One tricky question; for scalar, is it an Object Id, or "Natural" type? // for now, prefer Object Id: if (_objectIdReader != null) { JsonToken t = jp.getCurrentToken(); // should be good enough check; we only care about Strings, integral numbers: if (t != null && t.isScalarValue()) { return _deserializeFromObjectId(jp, ctxt); } } // First: support "natural" values (which are always serialized without type info!) Object result = _deserializeIfNatural(jp, ctxt); if (result != null) { return result; } return typeDeserializer.deserializeTypedFromObject(jp, ctxt); }
/** * Alternate build method used when we must be using some form of * abstract resolution, usually by using addition Type Id * ("polymorphic deserialization") * * @since 2.0 */ public AbstractDeserializer buildAbstract() { return new AbstractDeserializer(this, _beanDesc, _backRefProperties, _properties); }
throw new IllegalArgumentException("Can not find a deserializer for non-concrete Map type "+type); deser = AbstractDeserializer.constructForNonPOJO(beanDesc);
@Override public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException, JsonProcessingException { // Hmmh. One tricky question; for scalar, is it an Object Id, or "Natural" type? // for now, prefer Object Id: if (_objectIdReader != null) { JsonToken t = jp.getCurrentToken(); // should be good enough check; we only care about Strings, integral numbers: if (t != null && t.isScalarValue()) { return _deserializeFromObjectId(jp, ctxt); } } // First: support "natural" values (which are always serialized without type info!) Object result = _deserializeIfNatural(jp, ctxt); if (result != null) { return result; } return typeDeserializer.deserializeTypedFromObject(jp, ctxt); }
/** * Factory method used when constructing instances for non-POJO types, like * {@link java.util.Map}s. * * @since 2.3 */ public static AbstractDeserializer constructForNonPOJO(BeanDescription beanDesc) { return new AbstractDeserializer(beanDesc); }
throw new IllegalArgumentException("Cannot find a deserializer for non-concrete Map type "+type); deser = AbstractDeserializer.constructForNonPOJO(beanDesc);