org.apache.solr.response
Class TextResponseWriter

java.lang.Object
  extended by org.apache.solr.response.TextResponseWriter
Direct Known Subclasses:
TextResponseWriter

public abstract class TextResponseWriter
extends Object

Base class for text-oriented response writers.

Version:
$Id$

Field Summary
protected  boolean doIndent
           
protected  int level
           
protected  SolrQueryRequest req
           
protected  Set<String> returnFields
           
protected  SolrQueryResponse rsp
           
protected  IndexSchema schema
           
protected  org.apache.solr.common.util.FastWriter writer
           
 
Constructor Summary
TextResponseWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp)
           
 
Method Summary
 void close()
          done with this ResponseWriter...
 int decLevel()
           
 Writer getWriter()
          returns the Writer that the response is being written to
 int incLevel()
           
 void indent()
           
 void indent(int lev)
           
 int level()
           
 void setIndent(boolean doIndent)
           
 void setLevel(int level)
           
abstract  void writeArray(String name, Iterator val)
           
abstract  void writeArray(String name, Object[] val)
           
 void writeBool(String name, boolean val)
           
abstract  void writeBool(String name, String val)
          if this form of the method is called, val is the Java string form of a boolean
 void writeByte(String name, byte val)
           
abstract  void writeByte(String name, String s)
           
 void writeDate(String name, Date val)
           
abstract  void writeDate(String name, String val)
          if this form of the method is called, val is the Solr ISO8601 based date format
abstract  void writeDoc(String name, org.apache.lucene.document.Document doc, Set<String> returnFields, float score, boolean includeScore)
           
abstract  void writeDocList(String name, DocList ids, Set<String> fields, Map otherFields)
           
 void writeDouble(String name, double val)
           
abstract  void writeDouble(String name, String val)
          if this form of the method is called, val is the Java string form of a double
 void writeFloat(String name, float val)
           
abstract  void writeFloat(String name, String val)
          if this form of the method is called, val is the Java string form of a float
 void writeInt(String name, int val)
           
abstract  void writeInt(String name, String val)
          if this form of the method is called, val is the Java string form of an int
 void writeLong(String name, long val)
           
abstract  void writeLong(String name, String val)
          if this form of the method is called, val is the Java string form of a long
abstract  void writeMap(String name, Map val, boolean excludeOuter, boolean isFirstVal)
           
abstract  void writeNamedList(String name, org.apache.solr.common.util.NamedList val)
           
abstract  void writeNull(String name)
           
 void writeShort(String name, short val)
           
abstract  void writeShort(String name, String val)
           
abstract  void writeSolrDocument(String name, org.apache.solr.common.SolrDocument doc, Set<String> returnFields, Map pseudoFields)
           
abstract  void writeSolrDocumentList(String name, org.apache.solr.common.SolrDocumentList docs, Set<String> fields, Map otherFields)
           
abstract  void writeStr(String name, String val, boolean needsEscaping)
           
 void writeVal(String name, Object val)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writer

protected final org.apache.solr.common.util.FastWriter writer

schema

protected final IndexSchema schema

req

protected final SolrQueryRequest req

rsp

protected final SolrQueryResponse rsp

returnFields

protected Set<String> returnFields

level

protected int level

doIndent

protected boolean doIndent
Constructor Detail

TextResponseWriter

public TextResponseWriter(Writer writer,
                          SolrQueryRequest req,
                          SolrQueryResponse rsp)
Method Detail

close

public void close()
           throws IOException
done with this ResponseWriter... make sure any buffers are flushed to writer

Throws:
IOException

getWriter

public Writer getWriter()
returns the Writer that the response is being written to


indent

public void indent()
            throws IOException
Throws:
IOException

indent

public void indent(int lev)
            throws IOException
Throws:
IOException

setLevel

public void setLevel(int level)

level

public int level()

incLevel

public int incLevel()

decLevel

public int decLevel()

setIndent

public void setIndent(boolean doIndent)

writeNamedList

public abstract void writeNamedList(String name,
                                    org.apache.solr.common.util.NamedList val)
                             throws IOException
Throws:
IOException

writeVal

public void writeVal(String name,
                     Object val)
              throws IOException
Throws:
IOException

writeDoc

public abstract void writeDoc(String name,
                              org.apache.lucene.document.Document doc,
                              Set<String> returnFields,
                              float score,
                              boolean includeScore)
                       throws IOException
Throws:
IOException

writeSolrDocument

public abstract void writeSolrDocument(String name,
                                       org.apache.solr.common.SolrDocument doc,
                                       Set<String> returnFields,
                                       Map pseudoFields)
                                throws IOException
Throws:
IOException
Since:
solr 1.3

writeDocList

public abstract void writeDocList(String name,
                                  DocList ids,
                                  Set<String> fields,
                                  Map otherFields)
                           throws IOException
Throws:
IOException

writeSolrDocumentList

public abstract void writeSolrDocumentList(String name,
                                           org.apache.solr.common.SolrDocumentList docs,
                                           Set<String> fields,
                                           Map otherFields)
                                    throws IOException
Throws:
IOException
Since:
solr 1.3

writeStr

public abstract void writeStr(String name,
                              String val,
                              boolean needsEscaping)
                       throws IOException
Throws:
IOException

writeMap

public abstract void writeMap(String name,
                              Map val,
                              boolean excludeOuter,
                              boolean isFirstVal)
                       throws IOException
Throws:
IOException

writeArray

public abstract void writeArray(String name,
                                Object[] val)
                         throws IOException
Throws:
IOException

writeArray

public abstract void writeArray(String name,
                                Iterator val)
                         throws IOException
Throws:
IOException

writeNull

public abstract void writeNull(String name)
                        throws IOException
Throws:
IOException

writeInt

public abstract void writeInt(String name,
                              String val)
                       throws IOException
if this form of the method is called, val is the Java string form of an int

Throws:
IOException

writeInt

public void writeInt(String name,
                     int val)
              throws IOException
Throws:
IOException

writeLong

public abstract void writeLong(String name,
                               String val)
                        throws IOException
if this form of the method is called, val is the Java string form of a long

Throws:
IOException

writeLong

public void writeLong(String name,
                      long val)
               throws IOException
Throws:
IOException

writeBool

public abstract void writeBool(String name,
                               String val)
                        throws IOException
if this form of the method is called, val is the Java string form of a boolean

Throws:
IOException

writeBool

public void writeBool(String name,
                      boolean val)
               throws IOException
Throws:
IOException

writeFloat

public abstract void writeFloat(String name,
                                String val)
                         throws IOException
if this form of the method is called, val is the Java string form of a float

Throws:
IOException

writeFloat

public void writeFloat(String name,
                       float val)
                throws IOException
Throws:
IOException

writeDouble

public abstract void writeDouble(String name,
                                 String val)
                          throws IOException
if this form of the method is called, val is the Java string form of a double

Throws:
IOException

writeDouble

public void writeDouble(String name,
                        double val)
                 throws IOException
Throws:
IOException

writeDate

public void writeDate(String name,
                      Date val)
               throws IOException
Throws:
IOException

writeDate

public abstract void writeDate(String name,
                               String val)
                        throws IOException
if this form of the method is called, val is the Solr ISO8601 based date format

Throws:
IOException

writeShort

public abstract void writeShort(String name,
                                String val)
                         throws IOException
Throws:
IOException

writeShort

public void writeShort(String name,
                       short val)
                throws IOException
Throws:
IOException

writeByte

public abstract void writeByte(String name,
                               String s)
                        throws IOException
Throws:
IOException

writeByte

public void writeByte(String name,
                      byte val)
               throws IOException
Throws:
IOException


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.