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,PushWriter,JsonTextWriter,TextWriter
- Direct Known Subclasses:
SmileResponseWriter.SmileWriter
public class JSONWriter extends TextResponseWriter implements 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
-
Fields inherited from interface org.apache.solr.common.util.JsonTextWriter
hexdigits, JSON_NL_ARROFARR, JSON_NL_ARROFMAP, JSON_NL_ARROFNTV, JSON_NL_FLAT, JSON_NL_MAP, JSON_NL_STYLE
-
-
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()static voidwrite(Writer writer, boolean intend, String namedListStyle, Object val)Strictly for testing onlyvoidwriteEndDocumentList()voidwriteResponse()voidwriteSolrDocument(String name, SolrDocument doc, ReturnFields returnFields, int idx)voidwriteStartDocumentList(String name, long start, int size, long numFound, Float maxScore)-
Methods inherited from class org.apache.solr.response.TextResponseWriter
close, decLevel, doIndent, getWriter, incLevel, level, setIndent, setLevel, 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
-
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, writeLong, writeNumber, 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 intend, String namedListStyle, Object val) throws IOException
Strictly for testing only- Throws:
IOException
-
getNamedListStyle
public String getNamedListStyle()
- Specified by:
getNamedListStylein interfaceJsonTextWriter
-
writeResponse
public void writeResponse() throws IOException- Throws:
IOException
-
writeSolrDocument
public void writeSolrDocument(String name, 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) 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 interfaceJsonTextWriter- Throws:
IOException
-
_writeStr
public void _writeStr(String s) throws IOException
- Specified by:
_writeStrin interfaceJsonTextWriter- Throws:
IOException
-
-