All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.moodysalem.jaxrs.lib.contextresolvers.ObjectMapperContextResolver Maven / Gradle / Ivy

package com.moodysalem.jaxrs.lib.contextresolvers;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.moodysalem.jaxrs.lib.contextresolvers.jackson.modules.JodaTimeSerializerModule;

import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;

/**
 * Provides an object mapper with additional serialization support
 */
@Provider
public class ObjectMapperContextResolver implements ContextResolver {
    private static final ObjectMapper om;

    static {
        om = new ObjectMapper();
        om.registerModule(new JodaTimeSerializerModule());
    }

    @Override
    public ObjectMapper getContext(Class type) {
        return om;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy