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
Use this to serialize an object into Json. This only supports standard Objects and not the
server-side Objects
-
Field Summary
FieldsFields inherited from interface org.apache.solr.common.util.JsonTextWriter
hexdigits, JSON_NL_ARROFARR, JSON_NL_ARROFMAP, JSON_NL_ARROFNTV, JSON_NL_FLAT, JSON_NL_MAP, JSON_NL_STYLE -
Constructor Summary
ConstructorsConstructorDescriptionSolrJSONWriter(Writer writer) SolrJSONWriter(Writer writer, String namedListStyle) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.common.util.JsonTextWriter
unicodeEscape, 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, writeStrRawMethods inherited from interface org.apache.solr.common.util.TextWriter
indent, indent, writeArray, writeBool, writeBool, writeByteArr, writeDate, writeDouble, writeFloat, writeInt, writeIterator, writeLong, writeMap, writeNumber, writeVal, writeVal
-
Field Details
-
namedListStyle
-
level
protected int level -
doIndent
protected boolean doIndent
-
-
Constructor Details
-
SolrJSONWriter
-
SolrJSONWriter
-
-
Method Details
-
writeObj
- Throws:
IOException
-
close
done with all writing- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getNamedListStyle
- Specified by:
getNamedListStylein interfaceJsonTextWriter
-
_writeChar
- Specified by:
_writeCharin interfaceJsonTextWriter- Throws:
IOException
-
_writeStr
- Specified by:
_writeStrin interfaceJsonTextWriter- Throws:
IOException
-
setLevel
public void setLevel(int level) -
level
public int level()- Specified by:
levelin interfaceTextWriter
-
incLevel
public int incLevel()- Specified by:
incLevelin interfaceTextWriter
-
decLevel
public int decLevel()- Specified by:
decLevelin interfaceTextWriter
-
setIndent
- Specified by:
setIndentin interfaceTextWriter
-
doIndent
public boolean doIndent()- Specified by:
doIndentin interfaceTextWriter
-
getWriter
- Specified by:
getWriterin interfaceTextWriter
-