Class GsonMessageBodyWriter<T>

java.lang.Object
org.apache.hadoop.hbase.http.gson.GsonMessageBodyWriter<T>
All Implemented Interfaces:
org.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<T>

@Private @Produces("application/json") public final class GsonMessageBodyWriter<T> extends Object implements org.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<T>
Implements JSON serialization via Gson for JAX-RS.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final org.apache.hbase.thirdparty.com.google.gson.Gson
     
    private static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    GsonMessageBodyWriter(org.apache.hbase.thirdparty.com.google.gson.Gson gson)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isWriteable(Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType)
     
    private static Charset
    requestedCharset(org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType)
     
    void
    writeTo(T t, Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType, org.apache.hbase.thirdparty.javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter

    getSize
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • gson

      private final org.apache.hbase.thirdparty.com.google.gson.Gson gson
  • Constructor Details

    • GsonMessageBodyWriter

      @Inject public GsonMessageBodyWriter(org.apache.hbase.thirdparty.com.google.gson.Gson gson)
  • Method Details

    • isWriteable

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

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

      private static Charset requestedCharset(org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType)