@SuppressWarnings("unchecked") @Override public T deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException { return (T) typeDeserializer.deserializeTypedFromAny(jsonParser, deserializationContext); } }
/** * Base implementation that does not assume specific type * inclusion mechanism. Sub-classes are expected to override * this method if they are to handle type information. */ @Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { return typeDeserializer.deserializeTypedFromAny(p, ctxt); }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // Output can be as JSON Object, Array or scalar: no way to know a priori: return typeDeserializer.deserializeTypedFromAny(p, ctxt); }
/** * Deserialization called when type being deserialized is defined to * contain additional type identifier, to allow for correctly * instantiating correct subtype. This can be due to annotation on * type (or its supertype), or due to global settings without * annotations. *<p> * Default implementation may work for some types, but ideally subclasses * should not rely on current default implementation. * Implementation is mostly provided to avoid compilation errors with older * code. * * @param typeDeserializer Deserializer to use for handling type information */ public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // We could try calling return typeDeserializer.deserializeTypedFromAny(p, ctxt); }
@Override public Object deserializeWithType(JsonParser parser, DeserializationContext context, TypeDeserializer typeDeserializer) throws IOException { return typeDeserializer.deserializeTypedFromAny(parser, context); }
@Override public Object deserializeWithType(JsonParser parser, DeserializationContext context, TypeDeserializer deserializer) throws IOException { return deserializer.deserializeTypedFromAny(parser, context); }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { if (_deser == null) { // String never has type info return deserialize(p, ctxt); } return typeDeserializer.deserializeTypedFromAny(p, ctxt); }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // Not sure if we need to bother but: switch (p.getCurrentTokenId()) { case JsonTokenId.ID_START_ARRAY: case JsonTokenId.ID_START_OBJECT: case JsonTokenId.ID_FIELD_NAME: return typeDeserializer.deserializeTypedFromAny(p, ctxt); default: return null; } } }
@Override public Object deserializeWithType(JsonParser parser, DeserializationContext context, TypeDeserializer deserializer) throws IOException { /** * This is a nasty kludge right here, working around issues like * [datatype-jsr310#24]. But should work better than not having the work-around. */ if (parser.getCurrentToken().isScalarValue()) { return deserialize(parser, context); } return deserializer.deserializeTypedFromAny(parser, context); } }
@Override public Object deserializeWithType(JsonParser parser, DeserializationContext context, TypeDeserializer deserializer) throws IOException { /* This is a nasty kludge right here, working around issues like * [datatype-jsr310#24]. But should work better than not having the work-around. */ JsonToken t = parser.getCurrentToken(); if ((t != null) && t.isScalarValue()) { return deserialize(parser, context); } return deserializer.deserializeTypedFromAny(parser, context); } }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { final JsonToken t = p.getCurrentToken(); if (t == JsonToken.VALUE_NULL) { // can this actually happen? return getNullValue(ctxt); } // 22-Oct-2015, tatu: This handling is probably not needed (or is wrong), but // could be result of older (pre-2.7) Jackson trying to serialize natural types. // Because of this, let's allow for now, unless proven problematic /* if ((t != null) && t.isScalarValue()) { return deserialize(p, ctxt); } */ // 19-Apr-2016, tatu: Alas, due to there typically really being anything for Reference wrapper // itself, need to just ignore `typeDeser`, use TypeDeserializer we do have for contents // and it might just work. if (_valueTypeDeserializer == null) { return deserialize(p, ctxt); } return referenceValue(_valueTypeDeserializer.deserializeTypedFromAny(p, ctxt)); } }
case JsonTokenId.ID_START_OBJECT: case JsonTokenId.ID_FIELD_NAME: return typeDeserializer.deserializeTypedFromAny(p, ctxt);
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { return typeDeserializer.deserializeTypedFromAny(p, ctxt); }
case JsonTokenId.ID_FIELD_NAME: return typeDeserializer.deserializeTypedFromAny(p, ctxt);
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // Output can be as JSON Object, Array or scalar: no way to know a priori: return typeDeserializer.deserializeTypedFromAny(p, ctxt); }
@Override public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException, JsonProcessingException { /* Output can be as JSON Object, Array or scalar: no way to know * a priori. So: */ return typeDeserializer.deserializeTypedFromAny(jp, ctxt); }
@Override public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { return typeDeserializer.deserializeTypedFromAny(jp, ctxt); } }
/** * Base implementation that does not assume specific type * inclusion mechanism. Sub-classes are expected to override * this method if they are to handle type information. */ @Override public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { return typeDeserializer.deserializeTypedFromAny(jp, ctxt); }
@Override public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { if (_deser == null) { // String never has type info return deserialize(jp, ctxt); } return typeDeserializer.deserializeTypedFromAny(jp, ctxt); } }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { if (_deser == null) { // String never has type info return deserialize(p, ctxt); } return typeDeserializer.deserializeTypedFromAny(p, ctxt); }