net.aequologica.neo.serioulizer.jaxrs.ObjectMapperProvider Maven / Gradle / Ivy
The newest version!
package net.aequologica.neo.serioulizer.jaxrs;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
import net.aequologica.neo.serioulizer.jackson.AbstractReaderWriter;
@Provider
public class ObjectMapperProvider extends JacksonJsonProvider implements ContextResolver {
final ObjectMapper defaultObjectMapper;
public ObjectMapperProvider() {
defaultObjectMapper = AbstractReaderWriter.createMapper();
}
@Override
public ObjectMapper getContext(Class> type) {
return defaultObjectMapper;
}
}