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
FieldsFields inherited from class org.apache.solr.response.TextResponseWriter
cal, doIndent, level, req, returnFields, rsp, schema, writerFields 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
ConstructorsConstructorDescriptionJSONWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) JSONWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp, String wrapperFunction, String namedListStyle) -
Method Summary
Modifier and TypeMethodDescriptionvoid_writeChar(char c) voidprotected intheaderSize(Float maxScore, Boolean numFoundExact) static voidStrictly for testing onlyvoidvoidvoidwriteSolrDocument(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, writeValMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.common.util.JsonTextWriter
unicodeEscape, writeArray, 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, writeStrRawMethods 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
-
Field Details
-
namedListStyle
-
wrapperFunction
-
-
Constructor Details
-
JSONWriter
-
JSONWriter
public JSONWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp, String wrapperFunction, String namedListStyle)
-
-
Method Details
-
write
public static void write(Writer writer, boolean indent, String namedListStyle, Object val) throws IOException Strictly for testing only- Throws:
IOException
-
getNamedListStyle
- Specified by:
getNamedListStylein interfaceorg.apache.solr.common.util.JsonTextWriter
-
writeResponse
- 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
-
headerSize
-
writeEndDocumentList
- Specified by:
writeEndDocumentListin classTextResponseWriter- Throws:
IOException
-
_writeChar
- Specified by:
_writeCharin interfaceorg.apache.solr.common.util.JsonTextWriter- Throws:
IOException
-
_writeStr
- Specified by:
_writeStrin interfaceorg.apache.solr.common.util.JsonTextWriter- Throws:
IOException
-