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
,org.apache.solr.common.PushWriter
,org.apache.solr.common.util.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, boolean raw)
void
writeArray(String name, Iterator<?> iter, boolean raw)
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
writeIterator(String name, org.apache.solr.common.IteratorWriter val, boolean raw)
void
writeLong(String name, String val)
void
writeMap(String name, Map<?,?> map, boolean excludeOuter, boolean isFirstVal)
void
writeMap(String name, org.apache.solr.common.MapWriter val)
void
writeNamedList(String name, org.apache.solr.common.util.NamedList<?> val)
void
writeNull(String name)
void
writeResponse()
static void
writeResponse(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp)
void
writeSolrDocument(String name, org.apache.solr.common.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, Boolean numFoundExact)
void
writeStr(String name, String val, boolean escape)
void
writeStrRaw(String name, String val)
-
Methods inherited from class org.apache.solr.response.TextResponseWriter
close, decLevel, doIndent, getWriter, incLevel, level, setIndent, setLevel, shouldWriteRaw, writeDocuments, writeSolrDocumentList, writeVal
-
-
-
-
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, Boolean numFoundExact) throws IOException
- Specified by:
writeStartDocumentList
in classTextResponseWriter
- Throws:
IOException
-
writeSolrDocument
public void writeSolrDocument(String name, org.apache.solr.common.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, org.apache.solr.common.util.NamedList<?> val) throws IOException
- Throws:
IOException
-
writeMap
public void writeMap(String name, org.apache.solr.common.MapWriter 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, boolean raw) throws IOException
- Throws:
IOException
-
writeArray
public void writeArray(String name, Iterator<?> iter, boolean raw) throws IOException
- Throws:
IOException
-
writeIterator
public void writeIterator(String name, org.apache.solr.common.IteratorWriter val, boolean raw) throws IOException
- Throws:
IOException
-
writeNull
public void writeNull(String name) throws IOException
- Throws:
IOException
-
writeStrRaw
public void writeStrRaw(String name, String val) 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
-
-