I'm attempting to upgrade from Jackson 1.x to 2.x.
One area I'm having problems is where I was using a custom DeserializerFactory it looked like this:
objectMapper.setDeserializerProvider(objectMapper.getDeserializerProvider()
.withFactory(myFactory));
setDeserializerProvider is now gone in Jackson2 (although setSerializerProvider is still there). I was looking at using SimpleModule but that doesn't have what I need either.
How is this supposed to work in 2?
Update: I feel the need to emphasize that it needs to be a FACTORY. Not just registering a deserializer.
The custom factory passes information on to the Deserializer like this:
if (CollectionPage.class.equals(type.getRawClass())) {
final JsonDeserializer<Object> contentDeserializer = type.getContentType().getValueHandler();
return new MyCollectionDeserializer(type, contentDeserializer);
}
That value (contentDeserializer) is different at runtime for collections containing different types.