org.apache.solr.request
Class TextResponseWriter

java.lang.Object
  extended by org.apache.solr.request.TextResponseWriter

public abstract class TextResponseWriter
extends java.lang.Object

Base class for text-oriented response writers.

Version:
$Id$
Author:
yonik

Field Summary
protected  boolean doIndent
           
protected  int level
           
protected  SolrQueryRequest req
           
protected  java.util.Set<java.lang.String> returnFields
           
protected  SolrQueryResponse rsp
           
protected  IndexSchema schema
           
protected  java.io.Writer writer
           
 
Constructor Summary
TextResponseWriter(java.io.Writer writer, SolrQueryRequest req, SolrQueryResponse rsp)
           
 
Method Summary
 int decLevel()
           
 java.io.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(java.lang.String name, java.util.Iterator val)
           
abstract  void writeArray(java.lang.String name, java.lang.Object[] val)
           
 void writeBool(java.lang.String name, boolean val)
           
abstract  void writeBool(java.lang.String name, java.lang.String val)
          if this form of the method is called, val is the Java string form of a boolean
abstract  void writeDate(java.lang.String name, java.util.Date val)
           
abstract  void writeDate(java.lang.String name, java.lang.String val)
          if this form of the method is called, val is the Solr ISO8601 based date format
abstract  void writeDoc(java.lang.String name, org.apache.lucene.document.Document doc, java.util.Set<java.lang.String> returnFields, float score, boolean includeScore)
           
abstract  void writeDocList(java.lang.String name, DocList ids, java.util.Set<java.lang.String> fields, java.util.Map otherFields)
           
 void writeDouble(java.lang.String name, double val)
           
abstract  void writeDouble(java.lang.String name, java.lang.String val)
          if this form of the method is called, val is the Java string form of a double
 void writeFloat(java.lang.String name, float val)
           
abstract  void writeFloat(java.lang.String name, java.lang.String val)
          if this form of the method is called, val is the Java string form of a float
 void writeInt(java.lang.String name, int val)
           
abstract  void writeInt(java.lang.String name, java.lang.String val)
          if this form of the method is called, val is the Java string form of an int
 void writeLong(java.lang.String name, long val)
           
abstract  void writeLong(java.lang.String name, java.lang.String val)
          if this form of the method is called, val is the Java string form of a long
abstract  void writeMap(java.lang.String name, java.util.Map val, boolean excludeOuter, boolean isFirstVal)
           
abstract  void writeNamedList(java.lang.String name, NamedList val)
           
abstract  void writeNull(java.lang.String name)
           
abstract  void writeStr(java.lang.String name, java.lang.String val, boolean needsEscaping)
           
 void writeVal(java.lang.String name, java.lang.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 java.io.Writer writer

schema

protected final IndexSchema schema

req

protected final SolrQueryRequest req

rsp

protected final SolrQueryResponse rsp

returnFields

protected java.util.Set<java.lang.String> returnFields

level

protected int level

doIndent

protected boolean doIndent
Constructor Detail

TextResponseWriter

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

getWriter

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


indent

public void indent()
            throws java.io.IOException
Throws:
java.io.IOException

indent

public void indent(int lev)
            throws java.io.IOException
Throws:
java.io.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(java.lang.String name,
                                    NamedList val)
                             throws java.io.IOException
Throws:
java.io.IOException

writeVal

public void writeVal(java.lang.String name,
                     java.lang.Object val)
              throws java.io.IOException
Throws:
java.io.IOException

writeDoc

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

writeDocList

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

writeStr

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

writeMap

public abstract void writeMap(java.lang.String name,
                              java.util.Map val,
                              boolean excludeOuter,
                              boolean isFirstVal)
                       throws java.io.IOException
Throws:
java.io.IOException

writeArray

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

writeArray

public abstract void writeArray(java.lang.String name,
                                java.util.Iterator val)
                         throws java.io.IOException
Throws:
java.io.IOException

writeNull

public abstract void writeNull(java.lang.String name)
                        throws java.io.IOException
Throws:
java.io.IOException

writeInt

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

Throws:
java.io.IOException

writeInt

public void writeInt(java.lang.String name,
                     int val)
              throws java.io.IOException
Throws:
java.io.IOException

writeLong

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

Throws:
java.io.IOException

writeLong

public void writeLong(java.lang.String name,
                      long val)
               throws java.io.IOException
Throws:
java.io.IOException

writeBool

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

Throws:
java.io.IOException

writeBool

public void writeBool(java.lang.String name,
                      boolean val)
               throws java.io.IOException
Throws:
java.io.IOException

writeFloat

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

Throws:
java.io.IOException

writeFloat

public void writeFloat(java.lang.String name,
                       float val)
                throws java.io.IOException
Throws:
java.io.IOException

writeDouble

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

Throws:
java.io.IOException

writeDouble

public void writeDouble(java.lang.String name,
                        double val)
                 throws java.io.IOException
Throws:
java.io.IOException

writeDate

public abstract void writeDate(java.lang.String name,
                               java.util.Date val)
                        throws java.io.IOException
Throws:
java.io.IOException

writeDate

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

Throws:
java.io.IOException


Copyright © 2006 - 2009 The Apache Software Foundation