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 floatCURRENT_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 voidwriteArray(String name, Object[] val)voidwriteArray(String name, Iterator iter)voidwriteAttr(String name, String val, boolean escape)voidwriteBool(String name, String val)voidwriteDate(String name, String val)voidwriteDouble(String name, double val)voidwriteDouble(String name, String val)voidwriteEndDocumentList()voidwriteFloat(String name, float val)voidwriteFloat(String name, String val)voidwriteInt(String name, String val)voidwriteLong(String name, String val)voidwriteMap(String name, Map map, boolean excludeOuter, boolean isFirstVal)voidwriteNamedList(String name, NamedList val)voidwriteNull(String name)voidwriteResponse()static voidwriteResponse(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp)voidwriteSolrDocument(String name, SolrDocument doc, ReturnFields returnFields, int idx)The SolrDocument should already have multivalued fields implemented as Collections -- this will not rewrite to <arr>voidwriteStartDocumentList(String name, long start, int size, long numFound, Float maxScore)voidwriteStr(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:
writeStartDocumentListin 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:
writeSolrDocumentin classTextResponseWriter- Throws:
IOException
-
writeEndDocumentList
public void writeEndDocumentList() throws IOException- Specified by:
writeEndDocumentListin 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
-
-