com.sap.cloud.sdk.frameworks.jaxrs.GsonMessageBodyProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jaxrs-gson Show documentation
Show all versions of jaxrs-gson Show documentation
Framework adaptation for JAX-RS with Gson.
/*
* Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
*/
package com.sap.cloud.sdk.frameworks.jaxrs;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.nio.charset.StandardCharsets;
import javax.annotation.Nullable;
import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyReader;
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;
import com.google.gson.Gson;
import com.google.json.JsonSanitizer;
import com.sap.cloud.sdk.cloudplatform.servlet.response.ResponseGsonBuilder;
/**
* Message body reader and writer for JSON in JAX-RS.
*/
@Provider
@Consumes( MediaType.APPLICATION_JSON )
@Produces( MediaType.APPLICATION_JSON )
public class GsonMessageBodyProvider implements MessageBodyWriter
© 2015 - 2025 Weber Informatics LLC | Privacy Policy