net.winterly.rxjersey.server.RxGenericBodyWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-server Show documentation
Show all versions of core-server Show documentation
RxJava extension for Jersey and Dropwizard
package net.winterly.rxjersey.server;
import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.jersey.message.MessageBodyWorkers;
import javax.inject.Inject;
import javax.inject.Provider;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.List;
/**
* Generic {@link MessageBodyWriter} that overrides writer to serialise incoming entity as type of generic class.
* This class will only redirect writing to another {@link MessageBodyWriter}
* Requires list of supported types
*
* Providers implementing {@link RxGenericBodyWriter} must be programmatically registered in {@link ServiceLocator}
*/
public abstract class RxGenericBodyWriter implements MessageBodyWriter