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 Summary
Fields Modifier and Type Field Description protected StringnamedListStyleprotected StringwrapperFunction-
Fields inherited from class org.apache.solr.response.TextResponseWriter
cal, doIndent, level, req, returnFields, rsp, schema, writer
-
-
Constructor Summary
Constructors Constructor Description JSONWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp)JSONWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp, String wrapperFunction, String namedListStyle)
-
Method Summary
All 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.TextResponseWriter
close, decLevel, doIndent, getWriter, incLevel, level, setIndent, setLevel, shouldWriteRaw, writeDocuments, writeSolrDocumentList, writeVal
-
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.common.util.JsonTextWriter
unicodeEscape, 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.TextWriter
decLevel, doIndent, getWriter, incLevel, indent, indent, level, setIndent, writeArray, writeBool, writeBool, writeByteArr, writeDate, writeDouble, writeFloat, writeInt, writeIterator, writeLong, writeMap, writeNumber, writeVal, writeVal
-
-
-
-
Constructor Detail
-
JSONWriter
public JSONWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp)
-
JSONWriter
public JSONWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp, String wrapperFunction, String namedListStyle)
-
-
Method Detail
-
write
public static void write(Writer writer, boolean indent, String namedListStyle, Object val) throws IOException
Strictly for testing only- Throws:
IOException
-
getNamedListStyle
public String getNamedListStyle()
- Specified by:
getNamedListStylein interfaceorg.apache.solr.common.util.JsonTextWriter
-
writeResponse
public void writeResponse() throws IOException- Throws:
IOException
-
writeSolrDocument
public void writeSolrDocument(String name, org.apache.solr.common.SolrDocument doc, ReturnFields returnFields, int idx) throws IOException
- Specified by:
writeSolrDocumentin classTextResponseWriter- Throws:
IOException
-
writeStartDocumentList
public void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact) throws IOException
- Specified by:
writeStartDocumentListin classTextResponseWriter- Throws:
IOException
-
writeEndDocumentList
public void writeEndDocumentList() throws IOException- Specified by:
writeEndDocumentListin classTextResponseWriter- Throws:
IOException
-
_writeChar
public void _writeChar(char c) throws IOException- Specified by:
_writeCharin interfaceorg.apache.solr.common.util.JsonTextWriter- Throws:
IOException
-
_writeStr
public void _writeStr(String s) throws IOException
- Specified by:
_writeStrin interfaceorg.apache.solr.common.util.JsonTextWriter- Throws:
IOException
-
-