@Override public TypeDeserializer forProperty(BeanProperty prop) { return (prop == _property) ? this : new AsWrapperTypeDeserializer(this, prop); }
/** * Deserializing type id enclosed using WRAPPER_OBJECT style is straightforward */ @Override public Object deserializeTypedFromObject(JsonParser jp, DeserializationContext ctxt) throws IOException { return _deserialize(jp, ctxt); }
Object typeId = p.getTypeId(); if (typeId != null) { return _deserializeWithNativeTypeId(p, ctxt, typeId); ctxt.reportWrongTokenException(baseType(), JsonToken.FIELD_NAME, "need JSON String that contains type id (for subtype of "+baseTypeName()+")"); ctxt.reportWrongTokenException(baseType(), JsonToken.START_OBJECT, "need JSON Object to contain As.WRAPPER_OBJECT type information for class "+baseTypeName()); JsonDeserializer<Object> deser = _findDeserializer(ctxt, typeId); p.nextToken(); ctxt.reportWrongTokenException(baseType(), JsonToken.END_OBJECT, "expected closing END_OBJECT after type information and deserialized value");
Object typeId = jp.getTypeId(); if (typeId != null) { return _deserializeWithNativeTypeId(jp, ctxt, typeId); "need JSON Object to contain As.WRAPPER_OBJECT type information for class "+baseTypeName()); "need JSON String that contains type id (for subtype of "+baseTypeName()+")"); JsonDeserializer<Object> deser = _findDeserializer(ctxt, typeId); jp.nextToken();
"need JSON Object to contain As.WRAPPER_OBJECT type information for class "+baseTypeName()); "need JSON String that contains type id (for subtype of "+baseTypeName()+")"); JsonDeserializer<Object> deser = _findDeserializer(ctxt, typeId); jp.nextToken();
Object typeId = jp.getTypeId(); if (typeId != null) { return _deserializeWithNativeTypeId(jp, ctxt, typeId); "need JSON Object to contain As.WRAPPER_OBJECT type information for class "+baseTypeName()); "need JSON String that contains type id (for subtype of "+baseTypeName()+")"); JsonDeserializer<Object> deser = _findDeserializer(ctxt, typeId); jp.nextToken();
"need JSON Object to contain As.WRAPPER_OBJECT type information for class "+baseTypeName()); "need JSON String that contains type id (for subtype of "+baseTypeName()+")"); JsonDeserializer<Object> deser = _findDeserializer(ctxt, typeId); jp.nextToken();
@Override public Object deserializeTypedFromArray(JsonParser jp, DeserializationContext ctxt) throws IOException { return _deserialize(jp, ctxt); }
Object typeId = p.getTypeId(); if (typeId != null) { return _deserializeWithNativeTypeId(p, ctxt, typeId); "need JSON String that contains type id (for subtype of "+baseTypeName()+")"); "need JSON Object to contain As.WRAPPER_OBJECT type information for class "+baseTypeName()); JsonDeserializer<Object> deser = _findDeserializer(ctxt, typeId); p.nextToken();
Object typeId = p.getTypeId(); if (typeId != null) { return _deserializeWithNativeTypeId(p, ctxt, typeId); ctxt.reportWrongTokenException(baseType(), JsonToken.FIELD_NAME, "need JSON String that contains type id (for subtype of "+baseTypeName()+")"); ctxt.reportWrongTokenException(baseType(), JsonToken.START_OBJECT, "need JSON Object to contain As.WRAPPER_OBJECT type information for class "+baseTypeName()); JsonDeserializer<Object> deser = _findDeserializer(ctxt, typeId); p.nextToken(); ctxt.reportWrongTokenException(baseType(), JsonToken.END_OBJECT, "expected closing END_OBJECT after type information and deserialized value");
@Override public TypeDeserializer buildTypeDeserializer(DeserializationConfig config, JavaType baseType, Collection<NamedType> subtypes) { if (_idType == JsonTypeInfo.Id.NONE) { return null; } // 03-Oct-2016, tatu: As per [databind#1395] better prevent use for primitives, // regardless of setting if (baseType.isPrimitive()) { return null; } TypeIdResolver idRes = idResolver(config, baseType, subtypes, false, true); JavaType defaultImpl = defineDefaultImpl(config, baseType); // First, method for converting type info to type id: switch (_includeAs) { case WRAPPER_ARRAY: return new AsArrayTypeDeserializer(baseType, idRes, _typeProperty, _typeIdVisible, defaultImpl); case PROPERTY: case EXISTING_PROPERTY: // as per [#528] same class as PROPERTY return new AsPropertyTypeDeserializer(baseType, idRes, _typeProperty, _typeIdVisible, defaultImpl, _includeAs); case WRAPPER_OBJECT: return new AsWrapperTypeDeserializer(baseType, idRes, _typeProperty, _typeIdVisible, defaultImpl); case EXTERNAL_PROPERTY: return new AsExternalTypeDeserializer(baseType, idRes, _typeProperty, _typeIdVisible, defaultImpl); } throw new IllegalStateException("Do not know how to construct standard type serializer for inclusion type: "+_includeAs); }
@Override public Object deserializeTypedFromScalar(JsonParser jp, DeserializationContext ctxt) throws IOException { return _deserialize(jp, ctxt); }
@Override public TypeDeserializer forProperty(BeanProperty prop) { if (prop == _property) { // usually if it's null return this; } return new AsWrapperTypeDeserializer(this, prop); }
@Override public Object deserializeTypedFromAny(JsonParser jp, DeserializationContext ctxt) throws IOException { return _deserialize(jp, ctxt); }
@Override public TypeDeserializer forProperty(BeanProperty prop) { if (prop == _property) { // usually if it's null return this; } return new AsWrapperTypeDeserializer(this, prop); }
/** * Deserializing type id enclosed using WRAPPER_OBJECT style is straightforward */ @Override public Object deserializeTypedFromObject(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { return _deserialize(jp, ctxt); }
@Override public TypeDeserializer forProperty(BeanProperty prop) { return (prop == _property) ? this : new AsWrapperTypeDeserializer(this, prop); }
@Override public Object deserializeTypedFromAny(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { return _deserialize(jp, ctxt); }
@Override public TypeDeserializer forProperty(BeanProperty prop) { return (prop == _property) ? this : new AsWrapperTypeDeserializer(this, prop); }
/** * Deserializing type id enclosed using WRAPPER_OBJECT style is straightforward */ @Override public Object deserializeTypedFromObject(JsonParser jp, DeserializationContext ctxt) throws IOException { return _deserialize(jp, ctxt); }