com.talanlabs.componentjackson.ComponentBeanJacksonConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of component-jackson Show documentation
Show all versions of component-jackson Show documentation
Module Jackson for Component Bean
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