@Override
      public JsonSerializer<?> findSerializer(SerializationConfig config, JavaType type, BeanDescription beanDesc) {
        try {
          Codec<?> codec = registry.get(type.getRawClass());
          return serializer(codec);
        } catch (CodecConfigurationException e) {
          return null;
        }
      }
Create {@link CodecRegistry} adapter on the top of existing mapper instance
criteria/mongo/src/org/immutables/criteria/mongo/bson4jackson/JacksonCodecs.java