package org.jboss.resteasy.plugins.providers.jackson;
import org.codehaus.jackson.jaxrs.Annotations;
import org.codehaus.jackson.jaxrs.JacksonJsonProvider;
import org.jboss.resteasy.annotations.providers.NoJackson;
import org.jboss.resteasy.util.FindAnnotation;
import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.ext.Provider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
@Provider
@Consumes({"application/json", "application/*+json", "text/json"})
@Produces({"application/json", "application/*+json", "text/json"})
@Deprecated
public class ResteasyJacksonProvider extends JacksonJsonProvider
{
public ResteasyJacksonProvider() {
super(Annotations.JACKSON, Annotations.JAXB);
}
@Override
public boolean isReadable(Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType)
{
if (FindAnnotation.findAnnotation(aClass, annotations, NoJackson.class) != null) return false;
return super.isReadable(aClass, type, annotations, mediaType);
}
@Override
public boolean isWriteable(Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType)
{
if (FindAnnotation.findAnnotation(aClass, annotations, NoJackson.class) != null) return false;
return super.isWriteable(aClass, type, annotations, mediaType);
}
}