Class SdkGsonMessageBodyHandler<T>

java.lang.Object
com.iland.core.web.sdk.connection.SdkGsonMessageBodyHandler<T>
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<T>, javax.ws.rs.ext.MessageBodyWriter<T>

@Produces("application/*+json") @Consumes("application/*+json") public class SdkGsonMessageBodyHandler<T> extends Object implements javax.ws.rs.ext.MessageBodyWriter<T>, javax.ws.rs.ext.MessageBodyReader<T>
GSON serialization and deserialization for use with JAX RS.
Author:
Cory Snyder
  • Constructor Details

    • SdkGsonMessageBodyHandler

      public SdkGsonMessageBodyHandler()
  • Method Details

    • isReadable

      public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Specified by:
      isReadable in interface javax.ws.rs.ext.MessageBodyReader<T>
    • readFrom

      public T readFrom(Class<T> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream) throws IOException, javax.ws.rs.WebApplicationException
      Specified by:
      readFrom in interface javax.ws.rs.ext.MessageBodyReader<T>
      Throws:
      IOException
      javax.ws.rs.WebApplicationException
    • isWriteable

      public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Specified by:
      isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<T>
    • getSize

      public long getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Specified by:
      getSize in interface javax.ws.rs.ext.MessageBodyWriter<T>
    • writeTo

      public void writeTo(T t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException, javax.ws.rs.WebApplicationException
      Specified by:
      writeTo in interface javax.ws.rs.ext.MessageBodyWriter<T>
      Throws:
      IOException
      javax.ws.rs.WebApplicationException