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 SummaryFields Modifier and Type Field Description protected Calendarcalprotected booleandoIndentprotected intlevelprotected SolrQueryRequestreqprotected ReturnFieldsreturnFieldsprotected SolrQueryResponserspprotected IndexSchemaschemaprotected org.apache.solr.common.util.FastWriterwriter
 - 
Constructor SummaryConstructors Constructor Description TextResponseWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()done with this ResponseWriter...intdecLevel()booleandoIndent()WritergetWriter()returns the Writer that the response is being written tointincLevel()intlevel()TextResponseWritersetIndent(boolean doIndent)voidsetLevel(int level)protected booleanshouldWriteRaw(String fname, ReturnFields returnFields)NOTE: strict object equality check againstrawReturnFields; see javadocs forNO_RAW_FIELDSvoidwriteDocuments(String name, ResultContext res)abstract voidwriteEndDocumentList()abstract voidwriteSolrDocument(String name, org.apache.solr.common.SolrDocument doc, ReturnFields fields, int idx)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)voidwriteVal(String name, Object val, boolean raw)- 
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.TextWriterindent, indent, 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 Detail- 
writerprotected final org.apache.solr.common.util.FastWriter writer 
 - 
schemaprotected final IndexSchema schema 
 - 
reqprotected final SolrQueryRequest req 
 - 
rspprotected final SolrQueryResponse rsp 
 - 
returnFieldsprotected ReturnFields returnFields 
 - 
levelprotected int level 
 - 
doIndentprotected boolean doIndent 
 - 
calprotected Calendar cal 
 
- 
 - 
Constructor Detail- 
TextResponseWriterpublic TextResponseWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) 
 
- 
 - 
Method Detail- 
shouldWriteRawprotected final boolean shouldWriteRaw(String fname, ReturnFields returnFields) NOTE: strict object equality check againstrawReturnFields; see javadocs forNO_RAW_FIELDS
 - 
closepublic void close() throws IOExceptiondone with this ResponseWriter... make sure any buffers are flushed to writer- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 - 
doIndentpublic boolean doIndent() - Specified by:
- doIndentin interface- org.apache.solr.common.util.TextWriter
 
 - 
getWriterpublic Writer getWriter() returns the Writer that the response is being written to- Specified by:
- getWriterin interface- org.apache.solr.common.util.TextWriter
 
 - 
setLevelpublic void setLevel(int level) 
 - 
levelpublic int level() - Specified by:
- levelin interface- org.apache.solr.common.util.TextWriter
 
 - 
incLevelpublic int incLevel() - Specified by:
- incLevelin interface- org.apache.solr.common.util.TextWriter
 
 - 
decLevelpublic int decLevel() - Specified by:
- decLevelin interface- org.apache.solr.common.util.TextWriter
 
 - 
setIndentpublic TextResponseWriter setIndent(boolean doIndent) - Specified by:
- setIndentin interface- org.apache.solr.common.util.TextWriter
 
 - 
writeValpublic final void writeVal(String name, Object val, boolean raw) throws IOException - Specified by:
- writeValin interface- org.apache.solr.common.util.TextWriter
- Throws:
- IOException
 
 - 
writeStartDocumentListpublic abstract void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact) throws IOException - Throws:
- IOException
 
 - 
writeSolrDocumentpublic abstract void writeSolrDocument(String name, org.apache.solr.common.SolrDocument doc, ReturnFields fields, int idx) throws IOException - Throws:
- IOException
 
 - 
writeEndDocumentListpublic abstract void writeEndDocumentList() throws IOException- Throws:
- IOException
 
 - 
writeSolrDocumentListpublic final void writeSolrDocumentList(String name, org.apache.solr.common.SolrDocumentList docs, ReturnFields fields) throws IOException - Throws:
- IOException
 
 - 
writeDocumentspublic final void writeDocuments(String name, ResultContext res) throws IOException - Throws:
- IOException
 
 
- 
 
-