public abstract class JsonWriterSupport extends Object
init(Writer, JsonParserConfiguration)
method must be invoked before
any writeXXX method.JsonRecordParserFactory
Modifier and Type | Method and Description |
---|---|
protected int |
getIndent() |
protected String |
getLineSeparator() |
protected void |
init(Writer out,
JsonParserConfiguration config)
Initializes this object.
|
protected boolean |
isPretty() |
protected void |
write(Map<String,Object> map)
Writes a
Map in JSON object format. |
protected void |
writeArray(Iterable<Object> iterable)
Writes an
Iterable in JSON array format. |
protected void |
writeString(String text)
Writes a
String in JSON string format. |
protected void |
writeValue(Object value)
Writes a value in JSON format.
|
protected void init(Writer out, JsonParserConfiguration config)
out
- the Writer
to write toconfig
- the JsonParserConfiguration
protected void write(Map<String,Object> map) throws IOException
Map
in JSON object format.map
- the Map to writeIOException
protected void writeValue(Object value) throws IOException
Object.toString()
is called and the value is formatted as a JSON string.value
- the Object to writeIOException
protected void writeString(String text) throws IOException
String
in JSON string format.text
- the String
to writeIOException
protected void writeArray(Iterable<Object> iterable) throws IOException
Iterable
in JSON array format.iterable
- the Iterable
to writeIOException
protected boolean isPretty()
protected int getIndent()
protected String getLineSeparator()