starting with 1.1.0, the c'tor of StdCouchDbConnector that previously accepted an ObjectMapper instance is now expecting an ObjectMapperFactory.
The documentation of the ObjectMapperFactory interface, however, is rather sparse.
I've implemented it like this at the moment:
private class XyzObjectMapperFactory
implements ObjectMapperFactory {
public ObjectMapper createObjectMapper() {
// See http://wiki.fasterxml.com/JacksonMixInAnnotations
ObjectMapper result = new ObjectMapper();
result.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);
result.getSerializationConfig().addMixInAnnotations(Xyz.class, XyzMixIn.class);
result.getDeserializationConfig().addMixInAnnotations(Xyz.class, XyzMixIn.class);
return result;
}
public ObjectMapper createObjectMapper(CouchDbConnector connector) {
// OutOfDocumentationException
return createObjectMapper();
}
}
I've moved the creation of the previous ObjectMapper into the parameterless createObjectMapper() method.
I don't have any idea what the other method is supposed to do so I simply returned an instance of the same ObjectMapper.
What is the expected/correct way to implement that method?
Cheers,
Joern.
/H