Package org.apache.solr.common.util
Interface JsonTextWriter
- All Superinterfaces:
AutoCloseable,Closeable,PushWriter,TextWriter
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid_writeChar(char c) voiddefault voidunicodeEscape(Appendable out, int ch) default voidwriteArray(String name, Iterator<?> val, boolean raw) default voidwriteArray(String name, Iterator<?> val, int size, boolean raw) default voidwriteArray(String name, List<?> l, boolean raw) default voiddefault voidwriteArrayOpener(int size) default voiddefault voidif this form of the method is called, val is the Java string form of a booleandefault voidif 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 voidif this form of the method is called, val is the Java string form of an intdefault voidWrite an array.default voidwriteJsonIter(Iterator<?> val, boolean raw) default voiddefault voidif this form of the method is called, val is the Java string form of a longdefault voiddefault voidWrite a Map.default voiddefault voidwriteMapOpener(int size) default voiddefault 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 voiddefault voiddefault 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.TextWriter
decLevel, doIndent, getWriter, incLevel, indent, indent, level, setIndent, writeArray, writeBool, writeBool, writeByteArr, writeDate, writeDouble, writeFloat, writeInt, writeIterator, writeLong, writeMap, writeNumber, writeVal, writeVal
-
Field Details
-
hexdigits
static final char[] hexdigits -
JSON_NL_MAP
- See Also:
-
JSON_NL_FLAT
- See Also:
-
JSON_NL_ARROFARR
- See Also:
-
JSON_NL_ARROFMAP
- See Also:
-
JSON_NL_ARROFNTV
- See Also:
-
JSON_NL_STYLE
- See Also:
-
-
Method Details
-
getNamedListStyle
String getNamedListStyle() -
_writeChar
- Throws:
IOException
-
_writeStr
- Throws:
IOException
-
writeMapOpener
- Throws:
IOExceptionIllegalArgumentException
-
writeMapSeparator
- Throws:
IOException
-
writeMapCloser
- Throws:
IOException
-
writeArrayOpener
- Throws:
IOExceptionIllegalArgumentException
-
writeArraySeparator
- Throws:
IOException
-
writeArrayCloser
- Throws:
IOException
-
writeStrRaw
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 interfaceTextWriter- Throws:
IOException
-
writeStr
- Specified by:
writeStrin interfaceTextWriter- Throws:
IOException
-
writeIterator
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 interfacePushWriter- Specified by:
writeIteratorin interfaceTextWriter- Throws:
IOException
-
writeMap
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 interfacePushWriter- Specified by:
writeMapin interfaceTextWriter- Throws:
IOException
-
writeKey
- Throws:
IOException
-
writeJsonIter
- Throws:
IOException
-
writeNull
- Specified by:
writeNullin interfaceTextWriter- Throws:
IOException
-
writeInt
Description copied from interface:TextWriterif this form of the method is called, val is the Java string form of an int- Specified by:
writeIntin interfaceTextWriter- Throws:
IOException
-
writeLong
Description copied from interface:TextWriterif this form of the method is called, val is the Java string form of a long- Specified by:
writeLongin interfaceTextWriter- Throws:
IOException
-
writeBool
Description copied from interface:TextWriterif this form of the method is called, val is the Java string form of a boolean- Specified by:
writeBoolin interfaceTextWriter- Throws:
IOException
-
writeFloat
Description copied from interface:TextWriterif this form of the method is called, val is the Java string form of a float- Specified by:
writeFloatin interfaceTextWriter- Throws:
IOException
-
writeDouble
Description copied from interface:TextWriterif this form of the method is called, val is the Java string form of a double- Specified by:
writeDoublein interfaceTextWriter- Throws:
IOException
-
writeDate
Description copied from interface:TextWriterif this form of the method is called, val is the Solr ISO8601 based date format- Specified by:
writeDatein interfaceTextWriter- Throws:
IOException
-
writeMap
default void writeMap(String name, Map<?, ?> val, boolean excludeOuter, boolean isFirstVal) throws IOException- Specified by:
writeMapin interfaceTextWriter- Throws:
IOException
-
writeArray
- Specified by:
writeArrayin interfaceTextWriter- Throws:
IOException
-
writeArray
- Specified by:
writeArrayin interfaceTextWriter- Throws:
IOException
-
writeArray
- Specified by:
writeArrayin interfaceTextWriter- Throws:
IOException
-
unicodeEscape
- Throws:
IOException
-
writeNamedList
- Specified by:
writeNamedListin interfaceTextWriter- Throws:
IOException
-
writeNamedListAsMapMangled
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
-
writeNamedListAsMapWithDups
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
-
writeNamedListAsArrMap
- Throws:
IOException
-
writeNamedListAsArrArr
- Throws:
IOException
-
writeNamedListAsFlat
- Throws:
IOException
-