Package org.apache.solr.common.util
Class SolrJSONWriter
- java.lang.Object
- 
- org.apache.solr.common.util.SolrJSONWriter
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- PushWriter,- JsonTextWriter,- TextWriter
 
 public class SolrJSONWriter extends Object implements JsonTextWriter Use this to serialize an object into Json. This only supports standard Objects and not the server-side Objects
- 
- 
Field SummaryFields Modifier and Type Field Description protected booleandoIndentprotected intlevelprotected StringnamedListStyle- 
Fields inherited from interface org.apache.solr.common.util.JsonTextWriterhexdigits, JSON_NL_ARROFARR, JSON_NL_ARROFMAP, JSON_NL_ARROFNTV, JSON_NL_FLAT, JSON_NL_MAP, JSON_NL_STYLE
 
- 
 - 
Constructor SummaryConstructors Constructor Description SolrJSONWriter(Writer writer)SolrJSONWriter(Writer writer, String namedListStyle)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description void_writeChar(char c)void_writeStr(String s)voidclose()done with all writingintdecLevel()booleandoIndent()StringgetNamedListStyle()WritergetWriter()intincLevel()intlevel()SolrJSONWritersetIndent(boolean doIndent)voidsetLevel(int level)SolrJSONWriterwriteObj(Object o)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.solr.common.util.JsonTextWriterunicodeEscape, writeArray, writeArray, writeArrayCloser, writeArrayOpener, writeArraySeparator, writeBool, writeDate, writeDouble, writeFloat, writeInt, writeIterator, writeJsonIter, writeKey, writeLong, writeMap, writeMap, writeMapCloser, writeMapOpener, writeMapSeparator, writeNamedList, writeNamedListAsArrArr, writeNamedListAsArrMap, writeNamedListAsFlat, writeNamedListAsMapMangled, writeNamedListAsMapWithDups, writeNull, writeStr
 - 
Methods inherited from interface org.apache.solr.common.util.TextWriterindent, indent, writeArray, writeBool, writeBool, writeByteArr, writeDate, writeDouble, writeFloat, writeInt, writeLong, writeNumber, writeVal
 
- 
 
- 
- 
- 
Field Detail- 
namedListStyleprotected final String namedListStyle 
 - 
levelprotected int level 
 - 
doIndentprotected boolean doIndent 
 
- 
 - 
Method Detail- 
writeObjpublic SolrJSONWriter writeObj(Object o) throws IOException - Throws:
- IOException
 
 - 
closepublic void close() throws IOExceptiondone with all writing- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 - 
getNamedListStylepublic String getNamedListStyle() - Specified by:
- getNamedListStylein interface- JsonTextWriter
 
 - 
_writeCharpublic void _writeChar(char c) throws IOException- Specified by:
- _writeCharin interface- JsonTextWriter
- Throws:
- IOException
 
 - 
_writeStrpublic void _writeStr(String s) throws IOException - Specified by:
- _writeStrin interface- JsonTextWriter
- Throws:
- IOException
 
 - 
setLevelpublic void setLevel(int level) 
 - 
levelpublic int level() - Specified by:
- levelin interface- TextWriter
 
 - 
incLevelpublic int incLevel() - Specified by:
- incLevelin interface- TextWriter
 
 - 
decLevelpublic int decLevel() - Specified by:
- decLevelin interface- TextWriter
 
 - 
setIndentpublic SolrJSONWriter setIndent(boolean doIndent) - Specified by:
- setIndentin interface- TextWriter
 
 - 
doIndentpublic boolean doIndent() - Specified by:
- doIndentin interface- TextWriter
 
 - 
getWriterpublic Writer getWriter() - Specified by:
- getWriterin interface- TextWriter
 
 
- 
 
-