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
-
Constructor Summary
ConstructorDescriptionGsonMessageBodyWriter
(org.apache.hbase.thirdparty.com.google.gson.Gson gson) -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
-
gson
-
-
Constructor Details
-
GsonMessageBodyWriter
-
-
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 interfaceorg.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 interfaceorg.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)
-