Package org.apache.solr.common.util
Interface JsonTextWriter
- 
- All Superinterfaces:
- AutoCloseable,- Closeable,- PushWriter,- TextWriter
 - All Known Implementing Classes:
- SolrJSONWriter
 
 public interface JsonTextWriter extends TextWriter 
- 
- 
Field SummaryFields Modifier and Type Field Description static char[]hexdigitsstatic StringJSON_NL_ARROFARRstatic StringJSON_NL_ARROFMAPstatic StringJSON_NL_ARROFNTVstatic StringJSON_NL_FLATstatic StringJSON_NL_MAPstatic StringJSON_NL_STYLE
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void_writeChar(char c)void_writeStr(String s)StringgetNamedListStyle()default voidunicodeEscape(Appendable out, int ch)default voidwriteArray(String name, Iterator<?> val, boolean raw)default voidwriteArray(String name, List<?> l, boolean raw)default voidwriteArrayCloser()default voidwriteArrayOpener(int size)default voidwriteArraySeparator()default voidwriteBool(String name, String val)if this form of the method is called, val is the Java string form of a booleandefault voidwriteDate(String name, String val)if this form of the method is called, val is the Solr ISO8601 based date formatdefault voidwriteDouble(String name, String val)if this form of the method is called, val is the Java string form of a doubledefault voidwriteFloat(String name, String val)if this form of the method is called, val is the Java string form of a floatdefault voidwriteInt(String name, String val)if this form of the method is called, val is the Java string form of an intdefault voidwriteIterator(IteratorWriter val)Write an array.default voidwriteJsonIter(Iterator<?> val, boolean raw)default voidwriteKey(String fname, boolean needsEscaping)default voidwriteLong(String name, String val)if this form of the method is called, val is the Java string form of a longdefault voidwriteMap(String name, Map<?,?> val, boolean excludeOuter, boolean isFirstVal)default voidwriteMap(MapWriter val)Write a Map.default voidwriteMapCloser()default voidwriteMapOpener(int size)default voidwriteMapSeparator()default voidwriteNamedList(String name, NamedList<?> val)default voidwriteNamedListAsArrArr(String name, NamedList<?> val)default voidwriteNamedListAsArrMap(String name, NamedList<?> val)default voidwriteNamedListAsFlat(String name, NamedList<?> val)default voidwriteNamedListAsMapMangled(String name, NamedList<?> val)Represents a NamedList directly as a JSON Object (essentially a Map) Map null to "" and name mangle any repeated keys to avoid repeats in the output.default voidwriteNamedListAsMapWithDups(String name, NamedList<?> val)Represents a NamedList directly as a JSON Object (essentially a Map) repeating any keys if they are repeated in the NamedList.default voidwriteNull(String name)default voidwriteStr(String name, String val, boolean needsEscaping)default voidwriteStrRaw(String name, String val)Writes the specified val directly to the backing writer, without wrapping (e.g., in quotes) or escaping of any kind.- 
Methods inherited from interface org.apache.solr.common.util.TextWriterdecLevel, doIndent, getWriter, incLevel, indent, indent, level, setIndent, writeArray, writeBool, writeBool, writeByteArr, writeDate, writeDouble, writeFloat, writeInt, writeIterator, writeLong, writeMap, writeNumber, writeVal, writeVal
 
- 
 
- 
- 
- 
Field Detail- 
hexdigitsstatic final char[] hexdigits 
 - 
JSON_NL_MAPstatic final String JSON_NL_MAP - See Also:
- Constant Field Values
 
 - 
JSON_NL_FLATstatic final String JSON_NL_FLAT - See Also:
- Constant Field Values
 
 - 
JSON_NL_ARROFARRstatic final String JSON_NL_ARROFARR - See Also:
- Constant Field Values
 
 - 
JSON_NL_ARROFMAPstatic final String JSON_NL_ARROFMAP - See Also:
- Constant Field Values
 
 - 
JSON_NL_ARROFNTVstatic final String JSON_NL_ARROFNTV - See Also:
- Constant Field Values
 
 - 
JSON_NL_STYLEstatic final String JSON_NL_STYLE - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getNamedListStyleString getNamedListStyle() 
 - 
_writeCharvoid _writeChar(char c) throws IOException- Throws:
- IOException
 
 - 
_writeStrvoid _writeStr(String s) throws IOException - Throws:
- IOException
 
 - 
writeMapOpenerdefault void writeMapOpener(int size) throws IOException, IllegalArgumentException- Throws:
- IOException
- IllegalArgumentException
 
 - 
writeMapSeparatordefault void writeMapSeparator() throws IOException- Throws:
- IOException
 
 - 
writeMapCloserdefault void writeMapCloser() throws IOException- Throws:
- IOException
 
 - 
writeArrayOpenerdefault void writeArrayOpener(int size) throws IOException, IllegalArgumentException- Throws:
- IOException
- IllegalArgumentException
 
 - 
writeArraySeparatordefault void writeArraySeparator() throws IOException- Throws:
- IOException
 
 - 
writeArrayCloserdefault void writeArrayCloser() throws IOException- Throws:
- IOException
 
 - 
writeStrRawdefault void writeStrRaw(String name, String val) throws IOException Description copied from interface:TextWriterWrites the specified val directly to the backing writer, without wrapping (e.g., in quotes) or escaping of any kind.- Specified by:
- writeStrRawin interface- TextWriter
- Throws:
- IOException
 
 - 
writeStrdefault void writeStr(String name, String val, boolean needsEscaping) throws IOException - Specified by:
- writeStrin interface- TextWriter
- Throws:
- IOException
 
 - 
writeIteratordefault void writeIterator(IteratorWriter val) throws IOException Description copied from interface:PushWriterWrite an array. The array is opened at the beginning of this method and closed at the end. All array entries must be written before this method returns- Specified by:
- writeIteratorin interface- PushWriter
- Specified by:
- writeIteratorin interface- TextWriter
- Throws:
- IOException
 
 - 
writeMapdefault void writeMap(MapWriter val) throws IOException Description copied from interface:PushWriterWrite a Map. The map is opened in the beginning of the method and closed at the end. All map entries MUST be written before this method returns- Specified by:
- writeMapin interface- PushWriter
- Specified by:
- writeMapin interface- TextWriter
- Throws:
- IOException
 
 - 
writeKeydefault void writeKey(String fname, boolean needsEscaping) throws IOException - Throws:
- IOException
 
 - 
writeJsonIterdefault void writeJsonIter(Iterator<?> val, boolean raw) throws IOException - Throws:
- IOException
 
 - 
writeNulldefault void writeNull(String name) throws IOException - Specified by:
- writeNullin interface- TextWriter
- Throws:
- IOException
 
 - 
writeIntdefault void writeInt(String name, String val) throws IOException Description copied from interface:TextWriterif this form of the method is called, val is the Java string form of an int- Specified by:
- writeIntin interface- TextWriter
- Throws:
- IOException
 
 - 
writeLongdefault void writeLong(String name, String val) throws IOException Description copied from interface:TextWriterif this form of the method is called, val is the Java string form of a long- Specified by:
- writeLongin interface- TextWriter
- Throws:
- IOException
 
 - 
writeBooldefault void writeBool(String name, String val) throws IOException Description copied from interface:TextWriterif this form of the method is called, val is the Java string form of a boolean- Specified by:
- writeBoolin interface- TextWriter
- Throws:
- IOException
 
 - 
writeFloatdefault void writeFloat(String name, String val) throws IOException Description copied from interface:TextWriterif this form of the method is called, val is the Java string form of a float- Specified by:
- writeFloatin interface- TextWriter
- Throws:
- IOException
 
 - 
writeDoubledefault void writeDouble(String name, String val) throws IOException Description copied from interface:TextWriterif this form of the method is called, val is the Java string form of a double- Specified by:
- writeDoublein interface- TextWriter
- Throws:
- IOException
 
 - 
writeDatedefault void writeDate(String name, String val) throws IOException Description copied from interface:TextWriterif this form of the method is called, val is the Solr ISO8601 based date format- Specified by:
- writeDatein interface- TextWriter
- Throws:
- IOException
 
 - 
writeMapdefault void writeMap(String name, Map<?,?> val, boolean excludeOuter, boolean isFirstVal) throws IOException - Specified by:
- writeMapin interface- TextWriter
- Throws:
- IOException
 
 - 
writeArraydefault void writeArray(String name, List<?> l, boolean raw) throws IOException - Specified by:
- writeArrayin interface- TextWriter
- Throws:
- IOException
 
 - 
writeArraydefault void writeArray(String name, Iterator<?> val, boolean raw) throws IOException - Specified by:
- writeArrayin interface- TextWriter
- Throws:
- IOException
 
 - 
unicodeEscapedefault void unicodeEscape(Appendable out, int ch) throws IOException - Throws:
- IOException
 
 - 
writeNamedListdefault void writeNamedList(String name, NamedList<?> val) throws IOException - Specified by:
- writeNamedListin interface- TextWriter
- Throws:
- IOException
 
 - 
writeNamedListAsMapMangleddefault void writeNamedListAsMapMangled(String name, NamedList<?> val) throws IOException Represents a NamedList directly as a JSON Object (essentially a Map) Map null to "" and name mangle any repeated keys to avoid repeats in the output.- Throws:
- IOException
 
 - 
writeNamedListAsMapWithDupsdefault void writeNamedListAsMapWithDups(String name, NamedList<?> val) throws IOException Represents a NamedList directly as a JSON Object (essentially a Map) repeating any keys if they are repeated in the NamedList. null key is mapped to "".- Throws:
- IOException
 
 - 
writeNamedListAsArrMapdefault void writeNamedListAsArrMap(String name, NamedList<?> val) throws IOException - Throws:
- IOException
 
 - 
writeNamedListAsArrArrdefault void writeNamedListAsArrArr(String name, NamedList<?> val) throws IOException - Throws:
- IOException
 
 - 
writeNamedListAsFlatdefault void writeNamedListAsFlat(String name, NamedList<?> val) throws IOException - Throws:
- IOException
 
 
- 
 
-