org.apache.hadoop.hbase.rest.provider.producer
Class PlainTextMessageBodyProducer

java.lang.Object
  extended by org.apache.hadoop.hbase.rest.provider.producer.PlainTextMessageBodyProducer
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<Object>

@Provider
public class PlainTextMessageBodyProducer
extends Object
implements 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
PlainTextMessageBodyProducer()
           
 
Method Summary
 long getSize(Object object, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, javax.ws.rs.core.MediaType arg3)
           
 void writeTo(Object object, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream outStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlainTextMessageBodyProducer

public PlainTextMessageBodyProducer()
Method Detail

isWriteable

public boolean isWriteable(Class<?> arg0,
                           Type arg1,
                           Annotation[] arg2,
                           javax.ws.rs.core.MediaType arg3)
Specified by:
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<Object>

getSize

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

writeTo

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


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.