ValueInstantiator vi = bd.getValueInstantiator(); if (!vi.canCreateUsingDefault()) { // no default constructor Class<?> valueClass = prop.getType().getRawClass();
protected Object deserializeFromObjectUsingNonDefault(JsonParser p, DeserializationContext ctxt) throws IOException { final JsonDeserializer<Object> delegateDeser = _delegateDeserializer(); if (delegateDeser != null) { return _valueInstantiator.createUsingDelegate(ctxt, delegateDeser.deserialize(p, ctxt)); } if (_propertyBasedCreator != null) { return _deserializeUsingPropertyBased(p, ctxt); } // 25-Jan-2017, tatu: We do not actually support use of Creators for non-static // inner classes -- with one and only one exception; that of default constructor! // -- so let's indicate it Class<?> raw = _beanType.getRawClass(); if (ClassUtil.isNonStaticInnerClass(raw)) { return ctxt.handleMissingInstantiator(raw, null, p, "can only instantiate non-static inner class by using default, no-argument constructor"); } return ctxt.handleMissingInstantiator(raw, getValueInstantiator(), p, "cannot deserialize from Object value (no delegate- or property-based Creator)"); }
ValueInstantiator vi = ((BeanDeserializerBase) valueDeser).getValueInstantiator(); if (!vi.canCreateUsingDefault()) { final JavaType type = prop.getType();
delegateDeser.deserialize(p, ctxt)); return ctxt.handleMissingInstantiator(handledType(), getValueInstantiator(), p, "no suitable creator method found to deserialize from Number value (%s)", p.getNumberValue());
return ctxt.handleMissingInstantiator(handledType(), getValueInstantiator(), p, "no suitable creator method found to deserialize from Number value (%s)", p.getNumberValue());
public XmlTextDeserializer(BeanDeserializerBase delegate, SettableBeanProperty prop) { super(delegate); _xmlTextProperty = prop; _xmlTextPropertyIndex = prop.getPropertyIndex(); _valueInstantiator = delegate.getValueInstantiator(); }
public XmlTextDeserializer(BeanDeserializerBase delegate, int textPropIndex) { super(delegate); _xmlTextPropertyIndex = textPropIndex; _valueInstantiator = delegate.getValueInstantiator(); _xmlTextProperty = delegate.findProperty(textPropIndex); }
public XmlTextDeserializer(BeanDeserializerBase delegate, SettableBeanProperty prop) { super(delegate); _xmlTextProperty = prop; _xmlTextPropertyIndex = prop.getPropertyIndex(); _valueInstantiator = delegate.getValueInstantiator(); }
public XmlTextDeserializer(BeanDeserializerBase delegate, int textPropIndex) { super(delegate); _xmlTextPropertyIndex = textPropIndex; _valueInstantiator = delegate.getValueInstantiator(); _xmlTextProperty = delegate.findProperty(textPropIndex); }
@Override public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc, JsonDeserializer<?> deser0) { if (!(deser0 instanceof BeanDeserializerBase)) { return deser0; } /* 17-Aug-2013, tatu: One important special case first: if we have one "XML Text" * property, it may be exposed as VALUE_STRING token (depending on whether any attribute * values are exposed): and to deserialize from that, we need special handling unless POJO * has appropriate single-string creator method. */ BeanDeserializerBase deser = (BeanDeserializerBase) deser0; // Heuristics are bit tricky; but for now let's assume that if POJO // can already work with VALUE_STRING, it's ok and doesn't need extra support if (!deser.getValueInstantiator().canCreateFromString()) { SettableBeanProperty textProp = _findSoleTextProp(config, deser.properties()); if (textProp != null) { return new XmlTextDeserializer(deser, textProp); } } return new WrapperHandlingDeserializer(deser); }
@Override public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc, JsonDeserializer<?> deser0) { if (!(deser0 instanceof BeanDeserializerBase)) { return deser0; } /* 17-Aug-2013, tatu: One important special case first: if we have one "XML Text" * property, it may be exposed as VALUE_STRING token (depending on whether any attribute * values are exposed): and to deserialize from that, we need special handling unless POJO * has appropriate single-string creator method. */ BeanDeserializerBase deser = (BeanDeserializerBase) deser0; // Heuristics are bit tricky; but for now let's assume that if POJO // can already work with VALUE_STRING, it's ok and doesn't need extra support ValueInstantiator inst = deser.getValueInstantiator(); // 03-Aug-2017, tatu: [dataformat-xml#254] suggests we also should // allow passing `int`/`Integer`/`long`/`Long` cases, BUT // unfortunately we can not simple use default handling. Would need // coercion. if (!inst.canCreateFromString()) { SettableBeanProperty textProp = _findSoleTextProp(config, deser.properties()); if (textProp != null) { return new XmlTextDeserializer(deser, textProp); } } return new WrapperHandlingDeserializer(deser); }
ValueInstantiator vi = bd.getValueInstantiator(); if (!vi.canCreateUsingDefault()) { // no default constructor Class<?> valueClass = prop.getType().getRawClass();
ValueInstantiator vi = bd.getValueInstantiator(); if (!vi.canCreateUsingDefault()) { // no default constructor Class<?> valueClass = prop.getType().getRawClass();
ValueInstantiator vi = bd.getValueInstantiator(); if (!vi.canCreateUsingDefault()) { // no default constructor Class<?> valueClass = prop.getType().getRawClass();
ValueInstantiator vi = bd.getValueInstantiator(); if (!vi.canCreateUsingDefault()) { // no default constructor Class<?> valueClass = prop.getType().getRawClass();
ValueInstantiator vi = bd.getValueInstantiator(); if (!vi.canCreateUsingDefault()) { // no default constructor Class<?> valueClass = prop.getType().getRawClass();
ValueInstantiator vi = bd.getValueInstantiator(); if (!vi.canCreateUsingDefault()) { // no default constructor Class<?> valueClass = prop.getType().getRawClass();
protected Object deserializeFromObjectUsingNonDefault(JsonParser p, DeserializationContext ctxt) throws IOException { final JsonDeserializer<Object> delegateDeser = _delegateDeserializer(); if (delegateDeser != null) { return _valueInstantiator.createUsingDelegate(ctxt, delegateDeser.deserialize(p, ctxt)); } if (_propertyBasedCreator != null) { return _deserializeUsingPropertyBased(p, ctxt); } // 25-Jan-2017, tatu: We do not actually support use of Creators for non-static // inner classes -- with one and only one exception; that of default constructor! // -- so let's indicate it Class<?> raw = _beanType.getRawClass(); if (ClassUtil.isNonStaticInnerClass(raw)) { return ctxt.handleMissingInstantiator(raw, null, p, "can only instantiate non-static inner class by using default, no-argument constructor"); } return ctxt.handleMissingInstantiator(raw, getValueInstantiator(), p, "cannot deserialize from Object value (no delegate- or property-based Creator)"); }
delegateDeser.deserialize(p, ctxt)); return ctxt.handleMissingInstantiator(handledType(), getValueInstantiator(), p, "no suitable creator method found to deserialize from Number value (%s)", p.getNumberValue());
return ctxt.handleMissingInstantiator(handledType(), getValueInstantiator(), p, "no suitable creator method found to deserialize from Number value (%s)", p.getNumberValue());