com.redhat.rhevm.api.resteasy.json.JsonProvider Maven / Gradle / Ivy
/*
* Copyright © 2010 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.redhat.rhevm.api.resteasy.json;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.ext.Provider;
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJacksonProvider;
@Provider
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class JsonProvider extends ResteasyJacksonProvider
{
public JsonProvider() {
super();
setMapper(CustomObjectMapper.get());
}
@Override
public boolean isReadable(Class> aClass, Type type, Annotation[] annotations, MediaType mediaType) {
return super.isReadable(aClass, type, annotations, mediaType);
}
@Override
public boolean isWriteable(Class> aClass, Type type, Annotation[] annotations, MediaType mediaType) {
return super.isWriteable(aClass, type, annotations, mediaType);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy