Class JsonEntityConsumer<T>

  • All Implemented Interfaces:
    org.apache.hc.core5.http.nio.AsyncDataConsumer, org.apache.hc.core5.http.nio.AsyncEntityConsumer<T>, org.apache.hc.core5.http.nio.ResourceHolder

    public final class JsonEntityConsumer<T>
    extends org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer<T>
    • Field Summary

      • Fields inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer

        DEF_BUF_SIZE
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonEntityConsumer​(com.google.gson.Gson gson, com.google.gson.reflect.TypeToken<T> token)  
      JsonEntityConsumer​(com.google.gson.Gson gson, java.lang.Class<T> type)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int capacityIncrement()  
      protected void data​(java.nio.CharBuffer src, boolean endOfStream)  
      protected T generateContent()  
      void releaseResources()  
      protected void streamStart​(org.apache.hc.core5.http.ContentType contentType)  
      • Methods inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer

        completed, failed, getContent, streamStart
      • Methods inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer

        consume, setCharset, streamEnd, updateCapacity
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.hc.core5.http.nio.AsyncDataConsumer

        consume, streamEnd, updateCapacity
    • Constructor Detail

      • JsonEntityConsumer

        public JsonEntityConsumer​(com.google.gson.Gson gson,
                                  java.lang.Class<T> type)
      • JsonEntityConsumer

        public JsonEntityConsumer​(com.google.gson.Gson gson,
                                  com.google.gson.reflect.TypeToken<T> token)
    • Method Detail

      • streamStart

        protected void streamStart​(org.apache.hc.core5.http.ContentType contentType)
                            throws org.apache.hc.core5.http.HttpException
        Specified by:
        streamStart in class org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer<T>
        Throws:
        org.apache.hc.core5.http.HttpException
      • generateContent

        protected T generateContent()
                             throws java.io.IOException
        Specified by:
        generateContent in class org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer<T>
        Throws:
        java.io.IOException
      • capacityIncrement

        protected int capacityIncrement()
        Specified by:
        capacityIncrement in class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
      • data

        protected void data​(java.nio.CharBuffer src,
                            boolean endOfStream)
        Specified by:
        data in class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
      • releaseResources

        public void releaseResources()