Refine search
@SuppressWarnings("unchecked") @Override public Collection<String> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { if (_delegateDeserializer != null) { return (Collection<String>) _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(p, ctxt)); } final Collection<String> result = (Collection<String>) _valueInstantiator.createUsingDefault(ctxt); return deserialize(p, ctxt, result); }
@SuppressWarnings("unchecked") @Override public Collection<Object> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { if (_delegateDeserializer != null) { return (Collection<Object>) _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(p, ctxt)); } // Empty String may be ok; bit tricky to check, however, since // there is also possibility of "auto-wrapping" of single-element arrays. // Hence we only accept empty String here. if (p.hasToken(JsonToken.VALUE_STRING)) { String str = p.getText(); if (str.length() == 0) { return (Collection<Object>) _valueInstantiator.createFromString(ctxt, str); } } return deserialize(p, ctxt, createDefaultInstance(ctxt)); }
protected Object deserializeWithExternalTypeId(JsonParser p, DeserializationContext ctxt) throws IOException { if (_propertyBasedCreator != null) { return deserializeUsingPropertyBasedWithExternalTypeId(p, ctxt); } if (_delegateDeserializer != null) { /* 24-Nov-2015, tatu: Use of delegating creator needs to have precedence, and basically * external type id handling just has to be ignored, as they would relate to target * type and not delegate type. Whether this works as expected is another story, but * there's no other way to really mix these conflicting features. */ return _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(p, ctxt)); } return deserializeWithExternalTypeId(p, ctxt, _valueInstantiator.createUsingDefault(ctxt)); }
/** * Method called to deserialize POJO value from a JSON boolean value (true, false) */ public Object deserializeFromBoolean(JsonParser p, DeserializationContext ctxt) throws IOException { JsonDeserializer<Object> delegateDeser = _delegateDeserializer(); if (delegateDeser != null) { if (!_valueInstantiator.canCreateFromBoolean()) { Object bean = _valueInstantiator.createUsingDelegate(ctxt, delegateDeser.deserialize(p, ctxt)); if (_injectables != null) { injectValues(ctxt, bean); } return bean; } } boolean value = (p.getCurrentToken() == JsonToken.VALUE_TRUE); return _valueInstantiator.createFromBoolean(ctxt, value); }
@Override public EnumMap<?,?> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { if (_propertyBasedCreator != null) { return _deserializeUsingProperties(p, ctxt); } if (_delegateDeserializer != null) { return (EnumMap<?,?>) _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(p, ctxt)); } // Ok: must point to START_OBJECT JsonToken t = p.getCurrentToken(); if ((t != JsonToken.START_OBJECT) && (t != JsonToken.FIELD_NAME) && (t != JsonToken.END_OBJECT)) { // (empty) String may be ok however; or single-String-arg ctor if (t == JsonToken.VALUE_STRING) { return (EnumMap<?,?>) _valueInstantiator.createFromString(ctxt, p.getText()); } // slightly redundant (since String was passed above), but also handles empty array case: return _deserializeFromEmpty(p, ctxt); } EnumMap result = constructMap(ctxt); return deserialize(p, ctxt, result); }
public Object deserializeFromString(JsonParser p, DeserializationContext ctxt) throws IOException { // First things first: id Object Id is used, most likely that's it if (_objectIdReader != null) { return deserializeFromObjectId(p, ctxt); } // Bit complicated if we have delegating creator; may need to use it, // or might not... JsonDeserializer<Object> delegateDeser = _delegateDeserializer(); if (delegateDeser != null) { if (!_valueInstantiator.canCreateFromString()) { Object bean = _valueInstantiator.createUsingDelegate(ctxt, delegateDeser.deserialize(p, ctxt)); if (_injectables != null) { injectValues(ctxt, bean); } return bean; } } return _valueInstantiator.createFromString(ctxt, p.getText()); }
if (delegateDeser != null) { if (!_valueInstantiator.canCreateFromDouble()) { Object bean = _valueInstantiator.createUsingDelegate(ctxt, delegateDeser.deserialize(p, ctxt)); if (_injectables != null) { injectValues(ctxt, bean); return _valueInstantiator.createUsingDelegate(ctxt, delegateDeser.deserialize(p, ctxt));
if (delegateDeser != null) { if (!_valueInstantiator.canCreateFromString()) { Object bean = _valueInstantiator.createUsingDelegate(ctxt, delegateDeser.deserialize(p, ctxt)); if (_injectables != null) { injectValues(ctxt, bean);
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)"); }
return (Map<Object,Object>) _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(p, ctxt));
if (delegateDeser != null) { if (!_valueInstantiator.canCreateFromInt()) { Object bean = _valueInstantiator.createUsingDelegate(ctxt, delegateDeser.deserialize(p, ctxt)); if (_injectables != null) { injectValues(ctxt, bean); if (delegateDeser != null) { if (!_valueInstantiator.canCreateFromInt()) { Object bean = _valueInstantiator.createUsingDelegate(ctxt, delegateDeser.deserialize(p, ctxt)); if (_injectables != null) { injectValues(ctxt, bean); Object bean = _valueInstantiator.createUsingDelegate(ctxt, delegateDeser.deserialize(p, ctxt)); if (_injectables != null) { injectValues(ctxt, bean);
return _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(p, ctxt));
return _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(p, ctxt));
return _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(p, ctxt));
@SuppressWarnings("unchecked") @Override public Collection<Object> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { if (_delegateDeserializer != null) { return (Collection<Object>) _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(jp, ctxt)); } if (jp.getCurrentToken() == JsonToken.VALUE_STRING) { String str = jp.getText(); if (str.length() == 0) { return (Collection<Object>) _valueInstantiator.createFromString(ctxt, str); } } return deserialize(jp, ctxt, null); }
@SuppressWarnings("unchecked") @Override public Collection<Object> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { if (_delegateDeserializer != null) { return (Collection<Object>) _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(jp, ctxt)); } if (jp.getCurrentToken() == JsonToken.VALUE_STRING) { String str = jp.getText(); if (str.length() == 0) { return (Collection<Object>) _valueInstantiator.createFromString(ctxt, str); } } return deserialize(jp, ctxt, null); }
@SuppressWarnings("unchecked") @Override public Collection<String> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { if (_delegateDeserializer != null) { return (Collection<String>) _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(jp, ctxt)); } final Collection<String> result = (Collection<String>) _valueInstantiator.createUsingDefault(ctxt); return deserialize(jp, ctxt, result); }
@SuppressWarnings("unchecked") @Override public Collection<String> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { if (_delegateDeserializer != null) { return (Collection<String>) _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(p, ctxt)); } final Collection<String> result = (Collection<String>) _valueInstantiator.createUsingDefault(ctxt); return deserialize(p, ctxt, result); }
@SuppressWarnings("unchecked") @Override public Collection<Object> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { if (_delegateDeserializer != null) { return (Collection<Object>) _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(jp, ctxt)); } if (jp.getCurrentToken() == JsonToken.VALUE_STRING) { String str = jp.getText(); if (str.length() == 0) { return (Collection<Object>) _valueInstantiator.createFromString(ctxt, str); } } return deserialize(jp, ctxt, null); }
@SuppressWarnings("unchecked") @Override public Collection<String> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { if (_delegateDeserializer != null) { return (Collection<String>) _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(jp, ctxt)); } final Collection<String> result = (Collection<String>) _valueInstantiator.createUsingDefault(ctxt); return deserialize(jp, ctxt, result); }