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 class
JacksonJsonWriter.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.JsonFactory
jsonfactory
protected static com.fasterxml.jackson.core.util.DefaultPrettyPrinter
pretty
-
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 String
getContentType(SolrQueryRequest request, SolrQueryResponse response)
Return the applicable Content Type for a request, this method must be thread safe.org.apache.solr.common.PushWriter
getWriter(OutputStream out, SolrQueryRequest request, SolrQueryResponse response)
void
write(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:BinaryQueryResponseWriter
Use it to write the response in a binary format- Specified by:
write
in interfaceBinaryQueryResponseWriter
- Overrides:
write
in 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:QueryResponseWriter
Return 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:
getContentType
in interfaceQueryResponseWriter
- Overrides:
getContentType
in classBinaryResponseWriter
- Returns:
- a Content-Type string, which may not be null.
-
-