/** * Specialized called when we need to expose type id of `defaultImpl` when * serializing: we may need to expose it for assignment to a property, or * it may be requested as visible for some other reason. */ public String getDefaultTypeId() { Class<?> defaultType = _typeDeserializer.getDefaultImpl(); if (defaultType == null) { return null; } return _typeDeserializer.getTypeIdResolver().idFromValueAndType(null, defaultType); }
public String getDefaultTypeId() { Class<?> defaultType = _typeDeserializer.getDefaultImpl(); if (defaultType == null) { return null; } return _typeDeserializer.getTypeIdResolver().idFromValueAndType(null, defaultType); }
/** * Specialized called when we need to expose type id of `defaultImpl` when * serializing: we may need to expose it for assignment to a property, or * it may be requested as visible for some other reason. */ public String getDefaultTypeId() { Class<?> defaultType = _typeDeserializer.getDefaultImpl(); if (defaultType == null) { return null; } return _typeDeserializer.getTypeIdResolver().idFromValueAndType(null, defaultType); }
public String getDefaultTypeId() { Class<?> defaultType = _typeDeserializer.getDefaultImpl(); if (defaultType == null) { return null; } return _typeDeserializer.getTypeIdResolver().idFromValueAndType(null, defaultType); }
/** * Specialized called when we need to expose type id of `defaultImpl` when * serializing: we may need to expose it for assignment to a property, or * it may be requested as visible for some other reason. */ public String getDefaultTypeId() { Class<?> defaultType = _typeDeserializer.getDefaultImpl(); if (defaultType == null) { return null; } return _typeDeserializer.getTypeIdResolver().idFromValueAndType(null, defaultType); }
@Override public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { // Make sure we have a native type ID *AND* that we can resolve it to a type; otherwise, we'll end up in a recursive loop if (p.canReadTypeId()) { Object typeId = p.getTypeId(); if (typeId != null) { if (_typeDeserializer != null) { TypeIdResolver resolver = _typeDeserializer.getTypeIdResolver(); if (resolver != null && resolver.typeFromId(ctxt, typeId.toString()) != null) { return _typeDeserializer.deserializeTypedFromAny(p, ctxt); } } } } return super.deserialize(p, ctxt); }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // Use type deserializer if we have type information, even for scalar values if (typeDeserializer != null) { if (p.canReadTypeId()) { Object typeId = p.getTypeId(); if (typeId != null) { TypeIdResolver resolver = typeDeserializer.getTypeIdResolver(); // Make sure that we actually can resolve the type ID, otherwise we'll end up in a recursive loop if (resolver != null && resolver.typeFromId(ctxt, p.getTypeId().toString()) != null) { return typeDeserializer.deserializeTypedFromAny(p, ctxt); } } } } return super.deserializeWithType(p, ctxt, typeDeserializer); }
if (p.getTypeId() != null) { if (_typeDeserializer != null) { TypeIdResolver idResolver = _typeDeserializer.getTypeIdResolver(); JavaType keyType = idResolver.typeFromId(ctxt, p.getTypeId().toString()); if (keyType != null) {