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 Summary

Fields
`static char[]` `hexdigits`
`static String` `JSON_NL_ARROFARR`
`static String` `JSON_NL_ARROFMAP`
`static String` `JSON_NL_ARROFNTV`
`static String` `JSON_NL_FLAT`
`static String` `JSON_NL_MAP`
`static String` `JSON_NL_STYLE`

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`void` `_writeChar​(char c)`
`void` `_writeStr​(String s)`
`String` `getNamedListStyle()`
`default void` `unicodeEscape​(Appendable out, int ch)`
`default void` `writeArray​(String name, Iterator<?> val, boolean raw)`
`default void` `writeArray​(String name, List<?> l, boolean raw)`
`default void` `writeArrayCloser()`
`default void` `writeArrayOpener​(int size)`
`default void` `writeArraySeparator()`
`default void` `writeBool​(String name, String val)` if this form of the method is called, val is the Java string form of a boolean
`default void` `writeDate​(String name, String val)` if this form of the method is called, val is the Solr ISO8601 based date format
`default void` `writeDouble​(String name, String val)` if this form of the method is called, val is the Java string form of a double
`default void` `writeFloat​(String name, String val)` if this form of the method is called, val is the Java string form of a float
`default void` `writeInt​(String name, String val)` if this form of the method is called, val is the Java string form of an int
`default void` `writeIterator​(IteratorWriter val)` Write an array.
`default void` `writeJsonIter​(Iterator<?> val, boolean raw)`
`default void` `writeKey​(String fname, boolean needsEscaping)`
`default void` `writeLong​(String name, String val)` if this form of the method is called, val is the Java string form of a long
`default void` `writeMap​(String name, Map<?,​?> val, boolean excludeOuter, boolean isFirstVal)`
`default void` `writeMap​(MapWriter val)` Write a Map.
`default void` `writeMapCloser()`
`default void` `writeMapOpener​(int size)`
`default void` `writeMapSeparator()`
`default void` `writeNamedList​(String name, NamedList<?> val)`
`default void` `writeNamedListAsArrArr​(String name, NamedList<?> val)`
`default void` `writeNamedListAsArrMap​(String name, NamedList<?> val)`
`default void` `writeNamedListAsFlat​(String name, NamedList<?> val)`
`default void` `writeNamedListAsMapMangled​(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 void` `writeNamedListAsMapWithDups​(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 void` `writeNull​(String name)`
`default void` `writeStr​(String name, String val, boolean needsEscaping)`
`default void` `writeStrRaw​(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 java.io.Closeable

`close`

### 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 Detail

#### hexdigits

    static final char[] hexdigits

#### JSON_NL_MAP

    static final String JSON_NL_MAP

See Also:
  Constant Field Values

#### JSON_NL_FLAT

    static final String JSON_NL_FLAT

See Also:
  Constant Field Values

#### JSON_NL_ARROFARR

    static final String JSON_NL_ARROFARR

See Also:
  Constant Field Values

#### JSON_NL_ARROFMAP

    static final String JSON_NL_ARROFMAP

See Also:
  Constant Field Values

#### JSON_NL_ARROFNTV

    static final String JSON_NL_ARROFNTV

See Also:
  Constant Field Values

#### JSON_NL_STYLE

    static final String JSON_NL_STYLE

See Also:
  Constant Field Values

### Method Detail

#### getNamedListStyle

    String getNamedListStyle()

#### _writeChar

    void _writeChar​(char c)
             throws IOException

Throws:
  `IOException`

#### _writeStr

    void _writeStr​(String s)
            throws IOException

Throws:
  `IOException`

#### writeMapOpener

    default void writeMapOpener​(int size)
                         throws IOException,
                                IllegalArgumentException

Throws:
  `IOException`
  `IllegalArgumentException`

#### writeMapSeparator

    default void writeMapSeparator()
                            throws IOException

Throws:
  `IOException`

#### writeMapCloser

    default void writeMapCloser()
                         throws IOException

Throws:
  `IOException`

#### writeArrayOpener

    default void writeArrayOpener​(int size)
                           throws IOException,
                                  IllegalArgumentException

Throws:
  `IOException`
  `IllegalArgumentException`

#### writeArraySeparator

    default void writeArraySeparator()
                              throws IOException

Throws:
  `IOException`

#### writeArrayCloser

    default void writeArrayCloser()
                           throws IOException

Throws:
  `IOException`

#### writeStrRaw

    default void writeStrRaw​(String name,
                             String val)
                      throws IOException

Description copied from interface: `TextWriter`
Writes the specified val directly to the backing writer, without wrapping (e.g., in quotes) or escaping of any kind.

Specified by:
  `writeStrRaw` in interface `TextWriter`
Throws:
  `IOException`

#### writeStr

    default void writeStr​(String name,
                          String val,
                          boolean needsEscaping)
                   throws IOException

Specified by:
  `writeStr` in interface `TextWriter`
Throws:
  `IOException`

#### writeIterator

    default void writeIterator​(IteratorWriter val)
                        throws IOException

Description copied from interface: `PushWriter`
Write 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:
  `writeIterator` in interface `PushWriter`
Specified by:
  `writeIterator` in interface `TextWriter`
Throws:
  `IOException`

#### writeMap

    default void writeMap​(MapWriter val)
                   throws IOException

Description copied from interface: `PushWriter`
Write 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:
  `writeMap` in interface `PushWriter`
Specified by:
  `writeMap` in interface `TextWriter`
Throws:
  `IOException`

#### writeKey

    default void writeKey​(String fname,
                          boolean needsEscaping)
                   throws IOException

Throws:
  `IOException`

#### writeJsonIter

    default void writeJsonIter​(Iterator<?> val,
                               boolean raw)
                        throws IOException

Throws:
  `IOException`

#### writeNull

    default void writeNull​(String name)
                    throws IOException

Specified by:
  `writeNull` in interface `TextWriter`
Throws:
  `IOException`

#### writeInt

    default void writeInt​(String name,
                          String val)
                   throws IOException

Description copied from interface: `TextWriter`
if this form of the method is called, val is the Java string form of an int

Specified by:
  `writeInt` in interface `TextWriter`
Throws:
  `IOException`

#### writeLong

    default void writeLong​(String name,
                           String val)
                    throws IOException

Description copied from interface: `TextWriter`
if this form of the method is called, val is the Java string form of a long

Specified by:
  `writeLong` in interface `TextWriter`
Throws:
  `IOException`

#### writeBool

    default void writeBool​(String name,
                           String val)
                    throws IOException

Description copied from interface: `TextWriter`
if this form of the method is called, val is the Java string form of a boolean

Specified by:
  `writeBool` in interface `TextWriter`
Throws:
  `IOException`

#### writeFloat

    default void writeFloat​(String name,
                            String val)
                     throws IOException

Description copied from interface: `TextWriter`
if this form of the method is called, val is the Java string form of a float

Specified by:
  `writeFloat` in interface `TextWriter`
Throws:
  `IOException`

#### writeDouble

    default void writeDouble​(String name,
                             String val)
                      throws IOException

Description copied from interface: `TextWriter`
if this form of the method is called, val is the Java string form of a double

Specified by:
  `writeDouble` in interface `TextWriter`
Throws:
  `IOException`

#### writeDate

    default void writeDate​(String name,
                           String val)
                    throws IOException

Description copied from interface: `TextWriter`
if this form of the method is called, val is the Solr ISO8601 based date format

Specified by:
  `writeDate` in interface `TextWriter`
Throws:
  `IOException`

#### writeMap

    default void writeMap​(String name,
                          Map<?,​?> val,
                          boolean excludeOuter,
                          boolean isFirstVal)
                   throws IOException

Specified by:
  `writeMap` in interface `TextWriter`
Throws:
  `IOException`

#### writeArray

    default void writeArray​(String name,
                            List<?> l,
                            boolean raw)
                     throws IOException

Specified by:
  `writeArray` in interface `TextWriter`
Throws:
  `IOException`

#### writeArray

    default void writeArray​(String name,
                            Iterator<?> val,
                            boolean raw)
                     throws IOException

Specified by:
  `writeArray` in interface `TextWriter`
Throws:
  `IOException`

#### unicodeEscape

    default void unicodeEscape​(Appendable out,
                               int ch)
                        throws IOException

Throws:
  `IOException`

#### writeNamedList

    default void writeNamedList​(String name,
                                NamedList<?> val)
                         throws IOException

Specified by:
  `writeNamedList` in interface `TextWriter`
Throws:
  `IOException`

#### writeNamedListAsMapMangled

    default 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`

#### writeNamedListAsMapWithDups

    default 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`

#### writeNamedListAsArrMap

    default void writeNamedListAsArrMap​(String name,
                                        NamedList<?> val)
                                 throws IOException

Throws:
  `IOException`

#### writeNamedListAsArrArr

    default void writeNamedListAsArrArr​(String name,
                                        NamedList<?> val)
                                 throws IOException

Throws:
  `IOException`

#### writeNamedListAsFlat

    default void writeNamedListAsFlat​(String name,
                                      NamedList<?> val)
                               throws IOException

Throws:
  `IOException`