public class JSONWriter extends Object
| Constructor and Description |
|---|
JSONWriter(net.lecousin.framework.io.text.ICharacterStream.Writable.Buffered output,
boolean pretty)
Constructor.
|
JSONWriter(net.lecousin.framework.io.IO.Writable.Buffered output,
boolean pretty)
Constructor.
|
JSONWriter(net.lecousin.framework.io.IO.Writable.Buffered output,
Charset encoding,
boolean pretty)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
addObjectAttribute(String name)
Start a new object attribute, with its name followed by a semicolon.
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
addObjectAttribute(String name,
boolean value)
Add a boolean attribute to the current object.
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
addObjectAttribute(String name,
Number value)
Add a number attribute to the current object.
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
addObjectAttribute(String name,
String value)
Add a string attribute to the current object.
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
closeArray()
Close an array (]).
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
closeObject()
Close a JSON object (}).
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
endString()
End a string by closing double quotes.
|
static String |
escape(CharSequence s)
Escape a string to be written in JSON.
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
flush()
Flush any pending output.
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
openArray()
Open an array ([).
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
openObject()
Open a JSON object ({).
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
startNextArrayElement()
Start a new element in an array, writing a comma if a previous element is present.
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
startString()
Start a string by opening double quotes.
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
writeBoolean(boolean b)
Write a boolean.
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
writeNull()
Write null.
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
writeNumber(Number n)
Write a number.
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
writeString(CharSequence s)
Write a string between double quotes.
|
net.lecousin.framework.concurrent.async.IAsync<IOException> |
writeStringContent(CharSequence s)
Write a part of a string content.
|
public JSONWriter(net.lecousin.framework.io.IO.Writable.Buffered output,
boolean pretty)
public JSONWriter(net.lecousin.framework.io.IO.Writable.Buffered output,
Charset encoding,
boolean pretty)
public JSONWriter(net.lecousin.framework.io.text.ICharacterStream.Writable.Buffered output,
boolean pretty)
public static String escape(CharSequence s)
public net.lecousin.framework.concurrent.async.IAsync<IOException> flush()
public net.lecousin.framework.concurrent.async.IAsync<IOException> openObject()
public net.lecousin.framework.concurrent.async.IAsync<IOException> closeObject()
public net.lecousin.framework.concurrent.async.IAsync<IOException> addObjectAttribute(String name)
public net.lecousin.framework.concurrent.async.IAsync<IOException> addObjectAttribute(String name, boolean value)
public net.lecousin.framework.concurrent.async.IAsync<IOException> addObjectAttribute(String name, Number value)
public net.lecousin.framework.concurrent.async.IAsync<IOException> addObjectAttribute(String name, String value)
public net.lecousin.framework.concurrent.async.IAsync<IOException> openArray()
public net.lecousin.framework.concurrent.async.IAsync<IOException> closeArray()
public net.lecousin.framework.concurrent.async.IAsync<IOException> startNextArrayElement()
public net.lecousin.framework.concurrent.async.IAsync<IOException> writeNull()
public net.lecousin.framework.concurrent.async.IAsync<IOException> writeString(CharSequence s)
public net.lecousin.framework.concurrent.async.IAsync<IOException> startString()
public net.lecousin.framework.concurrent.async.IAsync<IOException> writeStringContent(CharSequence s)
public net.lecousin.framework.concurrent.async.IAsync<IOException> endString()
public net.lecousin.framework.concurrent.async.IAsync<IOException> writeNumber(Number n)
public net.lecousin.framework.concurrent.async.IAsync<IOException> writeBoolean(boolean b)
Copyright © 2019. All rights reserved.