Package org.apache.solr.response
Class JSONWriter
- java.lang.Object
- 
- org.apache.solr.response.TextResponseWriter
- 
- org.apache.solr.response.JSONWriter
 
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- org.apache.solr.common.PushWriter,- org.apache.solr.common.util.JsonTextWriter,- org.apache.solr.common.util.TextWriter
 - Direct Known Subclasses:
- JacksonJsonWriter.WriterImpl,- SmileResponseWriter.SmileWriter
 
 public class JSONWriter extends TextResponseWriter implements org.apache.solr.common.util.JsonTextWriter 
- 
- 
Field SummaryFields Modifier and Type Field Description protected StringnamedListStyleprotected StringwrapperFunction- 
Fields inherited from class org.apache.solr.response.TextResponseWritercal, doIndent, level, req, returnFields, rsp, schema, writer
 
- 
 - 
Constructor SummaryConstructors Constructor Description JSONWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp)JSONWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp, String wrapperFunction, String namedListStyle)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void_writeChar(char c)void_writeStr(String s)StringgetNamedListStyle()protected intheaderSize(Float maxScore, Boolean numFoundExact)static voidwrite(Writer writer, boolean indent, String namedListStyle, Object val)Strictly for testing onlyvoidwriteEndDocumentList()voidwriteResponse()voidwriteSolrDocument(String name, org.apache.solr.common.SolrDocument doc, ReturnFields returnFields, int idx)voidwriteStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact)- 
Methods inherited from class org.apache.solr.response.TextResponseWriterclose, decLevel, doIndent, getWriter, incLevel, level, setIndent, setLevel, shouldWriteRaw, writeDocuments, writeSolrDocumentList, writeVal
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.solr.common.util.JsonTextWriterunicodeEscape, writeArray, writeArray, writeArrayCloser, writeArrayOpener, writeArraySeparator, writeBool, writeDate, writeDouble, writeFloat, writeInt, writeIterator, writeJsonIter, writeKey, writeLong, writeMap, writeMap, writeMapCloser, writeMapOpener, writeMapSeparator, writeNamedList, writeNamedListAsArrArr, writeNamedListAsArrMap, writeNamedListAsFlat, writeNamedListAsMapMangled, writeNamedListAsMapWithDups, writeNull, writeStr, writeStrRaw
 - 
Methods inherited from interface org.apache.solr.common.util.TextWriterdecLevel, doIndent, getWriter, incLevel, indent, indent, level, setIndent, writeArray, writeBool, writeBool, writeByteArr, writeDate, writeDouble, writeFloat, writeInt, writeIterator, writeLong, writeMap, writeNumber, writeVal, writeVal
 
- 
 
- 
- 
- 
Constructor Detail- 
JSONWriterpublic JSONWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) 
 - 
JSONWriterpublic JSONWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp, String wrapperFunction, String namedListStyle) 
 
- 
 - 
Method Detail- 
writepublic static void write(Writer writer, boolean indent, String namedListStyle, Object val) throws IOException Strictly for testing only- Throws:
- IOException
 
 - 
getNamedListStylepublic String getNamedListStyle() - Specified by:
- getNamedListStylein interface- org.apache.solr.common.util.JsonTextWriter
 
 - 
writeResponsepublic void writeResponse() throws IOException- Throws:
- IOException
 
 - 
writeSolrDocumentpublic void writeSolrDocument(String name, org.apache.solr.common.SolrDocument doc, ReturnFields returnFields, int idx) throws IOException - Specified by:
- writeSolrDocumentin class- TextResponseWriter
- Throws:
- IOException
 
 - 
writeStartDocumentListpublic void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact) throws IOException - Specified by:
- writeStartDocumentListin class- TextResponseWriter
- Throws:
- IOException
 
 - 
writeEndDocumentListpublic void writeEndDocumentList() throws IOException- Specified by:
- writeEndDocumentListin class- TextResponseWriter
- Throws:
- IOException
 
 - 
_writeCharpublic void _writeChar(char c) throws IOException- Specified by:
- _writeCharin interface- org.apache.solr.common.util.JsonTextWriter
- Throws:
- IOException
 
 - 
_writeStrpublic void _writeStr(String s) throws IOException - Specified by:
- _writeStrin interface- org.apache.solr.common.util.JsonTextWriter
- Throws:
- IOException
 
 
- 
 
-