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 -
Constructor Summary
ConstructorsConstructorDescriptionGsonMessageBodyWriter(org.apache.hbase.thirdparty.com.google.gson.Gson gson) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType) private static CharsetrequestedCharset(org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType) voidwriteTo(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, waitMethods 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:
isWriteablein 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:
writeToin interfaceorg.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<T>- Throws:
IOExceptionorg.apache.hbase.thirdparty.javax.ws.rs.WebApplicationException
-
requestedCharset
private static Charset requestedCharset(org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType)
-