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
A JSON ResponseWriter that uses jackson.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.solr.response.BinaryResponseWriter
BinaryResponseWriter.Resolver -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.fasterxml.jackson.core.JsonFactoryprotected static final com.fasterxml.jackson.core.util.DefaultPrettyPrinterFields inherited from interface org.apache.solr.response.QueryResponseWriter
CONTENT_TYPE_TEXT_ASCII, CONTENT_TYPE_TEXT_UTF8, CONTENT_TYPE_XML_UTF8 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContentType(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 formatMethods inherited from class org.apache.solr.response.BinaryResponseWriter
getParsedResponse, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.response.BinaryQueryResponseWriter
serializeResponseMethods inherited from interface org.apache.solr.util.plugin.NamedListInitializedPlugin
init
-
Field Details
-
jsonfactory
protected final com.fasterxml.jackson.core.JsonFactory jsonfactory -
pretty
protected static final com.fasterxml.jackson.core.util.DefaultPrettyPrinter pretty
-
-
Constructor Details
-
JacksonJsonWriter
public JacksonJsonWriter()
-
-
Method Details
-
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
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.
-