Class PlainTextMessageBodyProducer
java.lang.Object
org.apache.hadoop.hbase.rest.provider.producer.PlainTextMessageBodyProducer
- All Implemented Interfaces:
org.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<Object>
@Provider
@Produces("text/plain")
@Private
public class PlainTextMessageBodyProducer
extends Object
implements org.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<Object>
An adapter between Jersey and Object.toString(). Hooks up plain text output to the Jersey content
handling framework. Jersey will first call getSize() to learn the number of bytes that will be
sent, then writeTo to perform the actual I/O.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetSize(Object object, Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType) booleanisWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType arg3) voidwriteTo(Object object, 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 outStream)
-
Constructor Details
-
PlainTextMessageBodyProducer
public PlainTextMessageBodyProducer()
-
-
Method Details
-
isWriteable
public boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType arg3) - Specified by:
isWriteablein interfaceorg.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<Object>
-
getSize
public long getSize(Object object, Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType) - Specified by:
getSizein interfaceorg.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<Object>
-
writeTo
public void writeTo(Object object, 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 outStream) throws IOException, org.apache.hbase.thirdparty.javax.ws.rs.WebApplicationException- Specified by:
writeToin interfaceorg.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<Object>- Throws:
IOExceptionorg.apache.hbase.thirdparty.javax.ws.rs.WebApplicationException
-