Package org.apache.solr.response
Class TextResponseWriter
java.lang.Object
org.apache.solr.response.TextResponseWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.solr.common.PushWriter,org.apache.solr.common.util.TextWriter
- Direct Known Subclasses:
JSONWriter,SchemaXmlWriter,TabularResponseWriter,XMLWriter
public abstract class TextResponseWriter
extends Object
implements org.apache.solr.common.util.TextWriter
Base class for text-oriented response writers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Calendarprotected booleanprotected intprotected final SolrQueryRequestprotected ReturnFieldsprotected final SolrQueryResponseprotected final IndexSchemaprotected final org.apache.solr.common.util.FastWriter -
Constructor Summary
ConstructorsConstructorDescriptionTextResponseWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()done with this ResponseWriter...intdecLevel()booleandoIndent()returns the Writer that the response is being written tointincLevel()intlevel()setIndent(boolean doIndent) voidsetLevel(int level) protected final booleanshouldWriteRaw(String fname, ReturnFields returnFields) NOTE: strict object equality check againstrawReturnFields; see javadocs forNO_RAW_FIELDSfinal voidwriteDocuments(String name, ResultContext res) abstract voidabstract voidwriteSolrDocument(String name, org.apache.solr.common.SolrDocument doc, ReturnFields fields, int idx) final voidwriteSolrDocumentList(String name, org.apache.solr.common.SolrDocumentList docs, ReturnFields fields) abstract voidwriteStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact) final voidMethods 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.TextWriter
indent, indent, writeArray, writeArray, writeArray, writeArray, writeBool, writeBool, writeBool, writeByteArr, writeDate, writeDate, writeDouble, writeDouble, writeFloat, writeFloat, writeInt, writeInt, writeIterator, writeIterator, writeLong, writeLong, writeMap, writeMap, writeMap, writeNamedList, writeNull, writeNumber, writeStr, writeStrRaw, writeVal
-
Field Details
-
writer
protected final org.apache.solr.common.util.FastWriter writer -
schema
-
req
-
rsp
-
returnFields
-
level
protected int level -
doIndent
protected boolean doIndent -
cal
-
-
Constructor Details
-
TextResponseWriter
-
-
Method Details
-
shouldWriteRaw
NOTE: strict object equality check againstrawReturnFields; see javadocs forNO_RAW_FIELDS -
close
done with this ResponseWriter... make sure any buffers are flushed to writer- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
doIndent
public boolean doIndent()- Specified by:
doIndentin interfaceorg.apache.solr.common.util.TextWriter
-
getWriter
returns the Writer that the response is being written to- Specified by:
getWriterin interfaceorg.apache.solr.common.util.TextWriter
-
setLevel
public void setLevel(int level) -
level
public int level()- Specified by:
levelin interfaceorg.apache.solr.common.util.TextWriter
-
incLevel
public int incLevel()- Specified by:
incLevelin interfaceorg.apache.solr.common.util.TextWriter
-
decLevel
public int decLevel()- Specified by:
decLevelin interfaceorg.apache.solr.common.util.TextWriter
-
setIndent
- Specified by:
setIndentin interfaceorg.apache.solr.common.util.TextWriter
-
writeVal
- Specified by:
writeValin interfaceorg.apache.solr.common.util.TextWriter- Throws:
IOException
-
writeStartDocumentList
public abstract void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact) throws IOException - Throws:
IOException
-
writeSolrDocument
public abstract void writeSolrDocument(String name, org.apache.solr.common.SolrDocument doc, ReturnFields fields, int idx) throws IOException - Throws:
IOException
-
writeEndDocumentList
- Throws:
IOException
-
writeSolrDocumentList
public final void writeSolrDocumentList(String name, org.apache.solr.common.SolrDocumentList docs, ReturnFields fields) throws IOException - Throws:
IOException
-
writeDocuments
- Throws:
IOException
-