public final class XMLWriter extends Object
Modifier and Type | Field and Description |
---|---|
static float |
CURRENT_VERSION |
Constructor and Description |
---|
XMLWriter(Writer writer,
IndexSchema schema,
SolrQueryRequest req,
String version) |
Modifier and Type | Method and Description |
---|---|
int |
decLevel() |
int |
incLevel() |
void |
indent() |
void |
indent(int lev) |
int |
level() |
void |
setIndent(boolean doIndent) |
void |
setLevel(int level) |
void |
startTag(String tag,
Map<String,String> attributes,
boolean closeTag,
boolean escape)
Writes a tag with attributes
|
void |
startTag(String tag,
String name,
boolean closeTag) |
void |
writeArray(String name,
Iterator iter) |
void |
writeArray(String name,
Object[] val) |
void |
writeAttr(String name,
String val)
Writes the XML attribute name/val.
|
void |
writeAttr(String name,
String val,
boolean escape) |
void |
writeBool(String name,
boolean val) |
void |
writeBool(String name,
String val) |
void |
writeByte(String name,
byte val) |
void |
writeByte(String name,
String val) |
void |
writeCdataTag(String tag,
Map<String,String> attributes,
String cdata,
boolean escapeCdata,
boolean escapeAttr)
Write a complete tag w/ attributes and cdata (the cdata is not enclosed in $lt;!
|
void |
writeDate(String name,
Date val) |
void |
writeDate(String name,
String val) |
void |
writeDoc(String name,
Document doc,
Set<String> returnFields,
float score,
boolean includeScore) |
void |
writeDocList(String name,
DocList ids,
Set<String> fields) |
void |
writeDouble(String name,
double val) |
void |
writeDouble(String name,
String val) |
void |
writeFloat(String name,
float val) |
void |
writeFloat(String name,
String val) |
void |
writeInt(String name,
int val) |
void |
writeInt(String name,
String val) |
void |
writeLong(String name,
long val) |
void |
writeLong(String name,
String val) |
void |
writeMap(String name,
Map<Object,Object> map)
writes a Map in the same format as a NamedList, using the
stringification of the key Object when it's non-null.
|
void |
writeNamedList(String name,
NamedList val) |
void |
writeNull(String name) |
void |
writePrim(String tag,
String name,
String val,
boolean escape) |
static void |
writeResponse(Writer writer,
SolrQueryRequest req,
SolrQueryResponse rsp) |
void |
writeShort(String name,
short val) |
void |
writeShort(String name,
String val) |
void |
writeSolrDocumentList(String name,
SolrDocumentList docs,
Set<String> fields) |
void |
writeStr(String name,
String val) |
void |
writeVal(String name,
Object val) |
public XMLWriter(Writer writer, IndexSchema schema, SolrQueryRequest req, String version)
public static void writeResponse(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException
IOException
public void setLevel(int level)
public int level()
public int incLevel()
public int decLevel()
public void setIndent(boolean doIndent)
public void writeAttr(String name, String val) throws IOException
IOException
public void writeAttr(String name, String val, boolean escape) throws IOException
IOException
public void startTag(String tag, Map<String,String> attributes, boolean closeTag, boolean escape) throws IOException
tag
- attributes
- closeTag
- escape
- IOException
public void writeCdataTag(String tag, Map<String,String> attributes, String cdata, boolean escapeCdata, boolean escapeAttr) throws IOException
tag
- attributes
- cdata
- escapeCdata
- escapeAttr
- IOException
public void startTag(String tag, String name, boolean closeTag) throws IOException
IOException
public void indent() throws IOException
IOException
public void indent(int lev) throws IOException
IOException
public final void writeDoc(String name, Document doc, Set<String> returnFields, float score, boolean includeScore) throws IOException
IOException
public final void writeSolrDocumentList(String name, SolrDocumentList docs, Set<String> fields) throws IOException
IOException
public final void writeDocList(String name, DocList ids, Set<String> fields) throws IOException
IOException
public void writeVal(String name, Object val) throws IOException
IOException
public void writeNamedList(String name, NamedList val) throws IOException
IOException
public void writeMap(String name, Map<Object,Object> map) throws IOException
name
- map
- IOException
Note on Returnable Data
public void writeArray(String name, Object[] val) throws IOException
IOException
public void writeArray(String name, Iterator iter) throws IOException
IOException
public void writeNull(String name) throws IOException
IOException
public void writeStr(String name, String val) throws IOException
IOException
public void writeInt(String name, String val) throws IOException
IOException
public void writeInt(String name, int val) throws IOException
IOException
public void writeLong(String name, String val) throws IOException
IOException
public void writeLong(String name, long val) throws IOException
IOException
public void writeBool(String name, String val) throws IOException
IOException
public void writeBool(String name, boolean val) throws IOException
IOException
public void writeShort(String name, String val) throws IOException
IOException
public void writeShort(String name, short val) throws IOException
IOException
public void writeByte(String name, String val) throws IOException
IOException
public void writeByte(String name, byte val) throws IOException
IOException
public void writeFloat(String name, String val) throws IOException
IOException
public void writeFloat(String name, float val) throws IOException
IOException
public void writeDouble(String name, String val) throws IOException
IOException
public void writeDouble(String name, double val) throws IOException
IOException
public void writeDate(String name, Date val) throws IOException
IOException
public void writeDate(String name, String val) throws IOException
IOException
public void writePrim(String tag, String name, String val, boolean escape) throws IOException
IOException