Package nl.vpro.domain.media.bind
Class CreditsDeserializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonDeserializer<Credits>
-
- nl.vpro.domain.media.bind.CreditsDeserializer
-
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider
public class CreditsDeserializer extends com.fasterxml.jackson.databind.JsonDeserializer<Credits>
Resolves polymorphism of credits. Make sure to unmarshal as aPerson
if that is appropriate, and toName
otherwise. UsingJsonTypeId
would have been possible too, but that would make the 'objectType' required, and we have to republish everything. There is not real reason, it is simple to recognize by other fields wether we want a Person or not. This class is added as a JsonDeserializer only onCredits
, and to avoid infinite recursion, in all extensions this is overridden by the default again. We do however includeCredits.getObjectType()
for the serializer, so other implementors (perhaps we in the future) may choose to switch on that after all.- Since:
- 5.12
- Author:
- Michiel Meeuwissen
-
-
Constructor Summary
Constructors Constructor Description CreditsDeserializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Credits
deserialize(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt)
-
Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
-
-
-
Method Detail
-
deserialize
public Credits deserialize(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt) throws IOException
- Specified by:
deserialize
in classcom.fasterxml.jackson.databind.JsonDeserializer<Credits>
- Throws:
IOException
-
-