org.ektorp.http
Class JacksonableEntity

java.lang.Object
  extended by org.apache.http.entity.AbstractHttpEntity
      extended by org.ektorp.http.JacksonableEntity
All Implemented Interfaces:
org.apache.http.HttpEntity

@NotThreadSafe
public class JacksonableEntity
extends org.apache.http.entity.AbstractHttpEntity

A streamed entity that obtains its content from an Object. The content obtained from the Object instance can optionally be buffered in a byte array in order to make the entity self-contained and repeatable.

See Also:
SerializableEntity

Field Summary
 
Fields inherited from class org.apache.http.entity.AbstractHttpEntity
chunked, contentEncoding, contentType, OUTPUT_BUFFER_SIZE
 
Constructor Summary
JacksonableEntity(Object ser, boolean bufferize, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
          Creates new instance of this class.
JacksonableEntity(Object ser, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
           
 
Method Summary
 boolean equals(Object o)
           
 InputStream getContent()
           
 long getContentLength()
           
 com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
           
 Object getTarget()
           
 boolean isRepeatable()
           
 boolean isStreaming()
           
 void writeTo(OutputStream outstream)
           
 
Methods inherited from class org.apache.http.entity.AbstractHttpEntity
consumeContent, getContentEncoding, getContentType, isChunked, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JacksonableEntity

public JacksonableEntity(Object ser,
                         boolean bufferize,
                         com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Creates new instance of this class.

Parameters:
ser - input
bufferize - tells whether the content should be stored in an internal buffer
Throws:
IOException - in case of an I/O error

JacksonableEntity

public JacksonableEntity(Object ser,
                         com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Method Detail

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getContent

public InputStream getContent()
                       throws IOException,
                              IllegalStateException
Throws:
IOException
IllegalStateException

getContentLength

public long getContentLength()

isRepeatable

public boolean isRepeatable()

isStreaming

public boolean isStreaming()

writeTo

public void writeTo(OutputStream outstream)
             throws IOException
Throws:
IOException

getTarget

public Object getTarget()

getObjectMapper

public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()


Copyright © 2017. All rights reserved.