Package org.apache.solr.response
Class JacksonJsonWriter
- java.lang.Object
 - 
- org.apache.solr.response.BinaryResponseWriter
 - 
- org.apache.solr.response.JacksonJsonWriter
 
 
 
- 
- All Implemented Interfaces:
 BinaryQueryResponseWriter,QueryResponseWriter,NamedListInitializedPlugin
public class JacksonJsonWriter extends BinaryResponseWriter
A JSON ResponseWriter that uses jackson. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJacksonJsonWriter.WriterImpl- 
Nested classes/interfaces inherited from class org.apache.solr.response.BinaryResponseWriter
BinaryResponseWriter.Resolver 
 - 
 
- 
Field Summary
Fields Modifier and Type Field Description protected com.fasterxml.jackson.core.JsonFactoryjsonfactoryprotected static com.fasterxml.jackson.core.PrettyPrinterpretty- 
Fields inherited from interface org.apache.solr.response.QueryResponseWriter
CONTENT_TYPE_TEXT_ASCII, CONTENT_TYPE_TEXT_UTF8, CONTENT_TYPE_XML_UTF8 
 - 
 
- 
Constructor Summary
Constructors Constructor Description JacksonJsonWriter() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetContentType(SolrQueryRequest request, SolrQueryResponse response)Return the applicable Content Type for a request, this method must be thread safe.org.apache.solr.common.PushWritergetWriter(OutputStream out, SolrQueryRequest request, SolrQueryResponse response)voidwrite(OutputStream out, SolrQueryRequest request, SolrQueryResponse response)Use it to write the response in a binary format- 
Methods inherited from class org.apache.solr.response.BinaryResponseWriter
getParsedResponse, write 
- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface org.apache.solr.response.BinaryQueryResponseWriter
serializeResponse 
- 
Methods inherited from interface org.apache.solr.util.plugin.NamedListInitializedPlugin
init 
 - 
 
 - 
 
- 
- 
Method Detail
- 
write
public void write(OutputStream out, SolrQueryRequest request, SolrQueryResponse response) throws IOException
Description copied from interface:BinaryQueryResponseWriterUse it to write the response in a binary format- Specified by:
 writein interfaceBinaryQueryResponseWriter- Overrides:
 writein classBinaryResponseWriter- Throws:
 IOException
 
- 
getWriter
public org.apache.solr.common.PushWriter getWriter(OutputStream out, SolrQueryRequest request, SolrQueryResponse response)
 
- 
getContentType
public String getContentType(SolrQueryRequest request, SolrQueryResponse response)
Description copied from interface:QueryResponseWriterReturn the applicable Content Type for a request, this method must be thread safe.QueryResponseWriter's must implement this method to return a valid HTTP Content-Type header for the request, that will logically correspond with the output produced by the write method.
- Specified by:
 getContentTypein interfaceQueryResponseWriter- Overrides:
 getContentTypein classBinaryResponseWriter- Returns:
 - a Content-Type string, which may not be null.
 
 
 - 
 
 -