org.apache.solr.response
Class XMLWriter

java.lang.Object
  extended by org.apache.solr.response.TextResponseWriter
      extended by org.apache.solr.response.XMLWriter

public class XMLWriter
extends TextResponseWriter

NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

Field Summary
static float CURRENT_VERSION
           
 
Fields inherited from class org.apache.solr.response.TextResponseWriter
cal, doIndent, level, req, returnFields, rsp, schema, writer
 
Constructor Summary
XMLWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp)
           
 
Method Summary
 void writeArray(String name, Iterator iter)
           
 void writeArray(String name, Object[] val)
           
 void writeAttr(String name, String val, boolean escape)
           
 void writeBool(String name, String val)
          if this form of the method is called, val is the Java string form of a boolean
 void writeDate(String name, String val)
          if this form of the method is called, val is the Solr ISO8601 based date format
 void writeDouble(String name, double val)
           
 void writeDouble(String name, String val)
          if this form of the method is called, val is the Java string form of a double
 void writeEndDocumentList()
           
 void writeFloat(String name, float val)
           
 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, String val)
          if this form of the method is called, val is the Java string form of an int
 void writeLong(String name, String val)
          if this form of the method is called, val is the Java string form of a long
 void writeMap(String name, Map map, boolean excludeOuter, boolean isFirstVal)
           
 void writeNamedList(String name, NamedList val)
           
 void writeNull(String name)
           
 void writeResponse()
           
static void writeResponse(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp)
           
 void writeSolrDocument(String name, SolrDocument doc, ReturnFields returnFields, int idx)
          The SolrDocument should already have multivalued fields implemented as Collections -- this will not rewrite to <arr>
 void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore)
           
 void writeStr(String name, String val, boolean escape)
           
 
Methods inherited from class org.apache.solr.response.TextResponseWriter
close, decLevel, getWriter, incLevel, indent, indent, level, setIndent, setLevel, toSolrDocument, writeBool, writeByteArr, writeDate, writeDocuments, writeInt, writeLong, writeSolrDocumentList, writeVal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CURRENT_VERSION

public static float CURRENT_VERSION
Constructor Detail

XMLWriter

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

writeResponse

public static void writeResponse(Writer writer,
                                 SolrQueryRequest req,
                                 SolrQueryResponse rsp)
                          throws IOException
Throws:
IOException

writeResponse

public void writeResponse()
                   throws IOException
Throws:
IOException

writeAttr

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

writeStartDocumentList

public void writeStartDocumentList(String name,
                                   long start,
                                   int size,
                                   long numFound,
                                   Float maxScore)
                            throws IOException
Specified by:
writeStartDocumentList in class TextResponseWriter
Throws:
IOException

writeSolrDocument

public void writeSolrDocument(String name,
                              SolrDocument doc,
                              ReturnFields returnFields,
                              int idx)
                       throws IOException
The SolrDocument should already have multivalued fields implemented as Collections -- this will not rewrite to <arr>

Specified by:
writeSolrDocument in class TextResponseWriter
Throws:
IOException

writeEndDocumentList

public void writeEndDocumentList()
                          throws IOException
Specified by:
writeEndDocumentList in class TextResponseWriter
Throws:
IOException

writeNamedList

public void writeNamedList(String name,
                           NamedList val)
                    throws IOException
Specified by:
writeNamedList in class TextResponseWriter
Throws:
IOException

writeMap

public void writeMap(String name,
                     Map map,
                     boolean excludeOuter,
                     boolean isFirstVal)
              throws IOException
Specified by:
writeMap in class TextResponseWriter
Throws:
IOException

writeArray

public void writeArray(String name,
                       Object[] val)
                throws IOException
Overrides:
writeArray in class TextResponseWriter
Throws:
IOException

writeArray

public void writeArray(String name,
                       Iterator iter)
                throws IOException
Specified by:
writeArray in class TextResponseWriter
Throws:
IOException

writeNull

public void writeNull(String name)
               throws IOException
Specified by:
writeNull in class TextResponseWriter
Throws:
IOException

writeStr

public void writeStr(String name,
                     String val,
                     boolean escape)
              throws IOException
Specified by:
writeStr in class TextResponseWriter
Throws:
IOException

writeInt

public void writeInt(String name,
                     String val)
              throws IOException
Description copied from class: TextResponseWriter
if this form of the method is called, val is the Java string form of an int

Specified by:
writeInt in class TextResponseWriter
Throws:
IOException

writeLong

public void writeLong(String name,
                      String val)
               throws IOException
Description copied from class: TextResponseWriter
if this form of the method is called, val is the Java string form of a long

Specified by:
writeLong in class TextResponseWriter
Throws:
IOException

writeBool

public void writeBool(String name,
                      String val)
               throws IOException
Description copied from class: TextResponseWriter
if this form of the method is called, val is the Java string form of a boolean

Specified by:
writeBool in class TextResponseWriter
Throws:
IOException

writeFloat

public void writeFloat(String name,
                       String val)
                throws IOException
Description copied from class: TextResponseWriter
if this form of the method is called, val is the Java string form of a float

Specified by:
writeFloat in class TextResponseWriter
Throws:
IOException

writeFloat

public void writeFloat(String name,
                       float val)
                throws IOException
Overrides:
writeFloat in class TextResponseWriter
Throws:
IOException

writeDouble

public void writeDouble(String name,
                        String val)
                 throws IOException
Description copied from class: TextResponseWriter
if this form of the method is called, val is the Java string form of a double

Specified by:
writeDouble in class TextResponseWriter
Throws:
IOException

writeDouble

public void writeDouble(String name,
                        double val)
                 throws IOException
Overrides:
writeDouble in class TextResponseWriter
Throws:
IOException

writeDate

public void writeDate(String name,
                      String val)
               throws IOException
Description copied from class: TextResponseWriter
if this form of the method is called, val is the Solr ISO8601 based date format

Specified by:
writeDate in class TextResponseWriter
Throws:
IOException


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