Package org.apache.solr.response
Class XMLWriter
- java.lang.Object
-
- org.apache.solr.response.TextResponseWriter
-
- org.apache.solr.response.XMLWriter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,PushWriter
,TextWriter
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
Fields Modifier and Type Field Description static float
CURRENT_VERSION
-
Fields inherited from class org.apache.solr.response.TextResponseWriter
cal, doIndent, level, req, returnFields, rsp, schema, writer
-
-
Constructor Summary
Constructors Constructor Description XMLWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
writeArray(String name, Object[] val)
void
writeArray(String name, Iterator iter)
void
writeAttr(String name, String val, boolean escape)
void
writeBool(String name, String val)
void
writeDate(String name, String val)
void
writeDouble(String name, double val)
void
writeDouble(String name, String val)
void
writeEndDocumentList()
void
writeFloat(String name, float val)
void
writeFloat(String name, String val)
void
writeInt(String name, String val)
void
writeLong(String name, String val)
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, doIndent, getWriter, incLevel, level, setIndent, setLevel, writeDocuments, writeSolrDocumentList, writeVal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.common.util.TextWriter
indent, indent, writeArray, writeBool, writeBool, writeByteArr, writeDate, writeInt, writeIterator, writeLong, writeMap, writeNumber
-
-
-
-
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 classTextResponseWriter
- 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 classTextResponseWriter
- Throws:
IOException
-
writeEndDocumentList
public void writeEndDocumentList() throws IOException
- Specified by:
writeEndDocumentList
in classTextResponseWriter
- Throws:
IOException
-
writeNamedList
public void writeNamedList(String name, NamedList val) throws IOException
- Throws:
IOException
-
writeMap
public void writeMap(String name, Map map, boolean excludeOuter, boolean isFirstVal) throws IOException
- Throws:
IOException
-
writeArray
public void writeArray(String name, Object[] val) throws IOException
- Throws:
IOException
-
writeArray
public void writeArray(String name, Iterator iter) throws IOException
- Throws:
IOException
-
writeNull
public void writeNull(String name) throws IOException
- Throws:
IOException
-
writeStr
public void writeStr(String name, String val, boolean escape) throws IOException
- Throws:
IOException
-
writeInt
public void writeInt(String name, String val) throws IOException
- Throws:
IOException
-
writeLong
public void writeLong(String name, String val) throws IOException
- Throws:
IOException
-
writeBool
public void writeBool(String name, String val) throws IOException
- Throws:
IOException
-
writeFloat
public void writeFloat(String name, String val) throws IOException
- Throws:
IOException
-
writeFloat
public void writeFloat(String name, float val) throws IOException
- Throws:
IOException
-
writeDouble
public void writeDouble(String name, String val) throws IOException
- Throws:
IOException
-
writeDouble
public void writeDouble(String name, double val) throws IOException
- Throws:
IOException
-
writeDate
public void writeDate(String name, String val) throws IOException
- Throws:
IOException
-
-