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

com.talanlabs.componentjackson.ComponentBeanJacksonConfig Maven / Gradle / Ivy

The newest version!
package com.talanlabs.componentjackson;

import com.fasterxml.jackson.databind.ObjectMapper;

import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;

@Provider
@Produces(MediaType.APPLICATION_JSON)
public class ComponentBeanJacksonConfig implements ContextResolver {

    private ObjectMapper objectMapper;

    public ComponentBeanJacksonConfig() {
        super();

        this.objectMapper = new ObjectMapper();
        this.objectMapper.registerModule(new ComponentBeanModule());
    }

    @Override
    public ObjectMapper getContext(Class type) {
        return this.objectMapper;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy