Jackson2 custom deserializer factory

jackson

Solution

In Jackson 2.0:

- Create a `Module` (usually `SimpleModule`)

- Register custom handlers with it.

- Call `ObjectMapper.registerModule(module);`.

This is available on Jackson 1.x as well (since 1.8 or so).

Problem

I am porting jackson 1.6 code to jackson 2 and stumbled upon a deprecated code. What i did in jackson 1.6 is: ``` CustomDeserializerFactory sf = new CustomDeserializerFactory(); mapper.setDeserializerProvider(new StdDeserializerProvider(sf)); sf.addSpecificMapping(BigDecimal.class, new BigDecimalDeserializer()); t = mapper.readValue(ts, X[].class); ``` Anyone knows how to do it in jackson 2?

Original source