public class TextJsonGenerator extends Object implements CookJsonGenerator
PrettyTextJsonGenerator.PRETTY_PRINTING| Constructor and Description |
|---|
TextJsonGenerator(OutputStream os) |
TextJsonGenerator(Writer out) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
int |
getBinaryFormat()
Gets the binary format for storing byte[].
|
boolean |
isKeyNameEscaped()
Check if key name is escaped.
|
void |
setBinaryFormat(int binaryFormat)
Sets the binary format for storing byte[].
|
void |
setKeyNameEscaped(boolean b)
By default, key name is escaped.
|
JsonGenerator |
write(BigDecimal value) |
JsonGenerator |
write(BigInteger value) |
JsonGenerator |
write(boolean value) |
JsonGenerator |
write(byte[] value)
Writes the specified data as a binary value within the current
array context.
|
JsonGenerator |
write(double value) |
JsonGenerator |
write(int value) |
JsonGenerator |
write(JsonValue value) |
JsonGenerator |
write(long value) |
JsonGenerator |
write(String value) |
JsonGenerator |
write(String name,
BigDecimal value) |
JsonGenerator |
write(String name,
BigInteger value) |
JsonGenerator |
write(String name,
boolean value) |
JsonGenerator |
write(String name,
byte[] value)
Writes the specified data as a binary value within the current
object context.
|
JsonGenerator |
write(String name,
double value) |
JsonGenerator |
write(String name,
int value) |
JsonGenerator |
write(String name,
JsonValue value) |
JsonGenerator |
write(String name,
long value) |
JsonGenerator |
write(String name,
String value) |
JsonGenerator |
writeEnd() |
JsonGenerator |
writeNull() |
JsonGenerator |
writeNull(String name) |
JsonGenerator |
writeStartArray() |
JsonGenerator |
writeStartArray(String name) |
JsonGenerator |
writeStartObject() |
JsonGenerator |
writeStartObject(String name) |
public TextJsonGenerator(OutputStream os)
public TextJsonGenerator(Writer out)
public JsonGenerator writeStartObject()
writeStartObject in interface JsonGeneratorpublic JsonGenerator writeStartObject(String name)
writeStartObject in interface JsonGeneratorpublic JsonGenerator writeStartArray()
writeStartArray in interface JsonGeneratorpublic JsonGenerator writeStartArray(String name)
writeStartArray in interface JsonGeneratorpublic JsonGenerator write(String name, JsonValue value)
write in interface JsonGeneratorpublic JsonGenerator write(String name, byte[] value)
CookJsonGeneratorwrite in interface CookJsonGeneratorname - the key name.value - a binary data to be writtenCookJsonBinarypublic JsonGenerator write(String name, String value)
write in interface JsonGeneratorpublic JsonGenerator write(String name, BigInteger value)
write in interface JsonGeneratorpublic JsonGenerator write(String name, BigDecimal value)
write in interface JsonGeneratorpublic JsonGenerator write(String name, int value)
write in interface JsonGeneratorpublic JsonGenerator write(String name, long value)
write in interface JsonGeneratorpublic JsonGenerator write(String name, double value)
write in interface JsonGeneratorpublic JsonGenerator write(String name, boolean value)
write in interface JsonGeneratorpublic JsonGenerator writeNull(String name)
writeNull in interface JsonGeneratorpublic JsonGenerator writeEnd()
writeEnd in interface JsonGeneratorpublic JsonGenerator write(JsonValue value)
write in interface JsonGeneratorpublic JsonGenerator write(byte[] value)
CookJsonGeneratorwrite in interface CookJsonGeneratorvalue - a binary data to be writtenCookJsonBinarypublic JsonGenerator write(String value)
write in interface JsonGeneratorpublic JsonGenerator write(BigDecimal value)
write in interface JsonGeneratorpublic JsonGenerator write(BigInteger value)
write in interface JsonGeneratorpublic JsonGenerator write(int value)
write in interface JsonGeneratorpublic JsonGenerator write(long value)
write in interface JsonGeneratorpublic JsonGenerator write(double value)
write in interface JsonGeneratorpublic JsonGenerator write(boolean value)
write in interface JsonGeneratorpublic JsonGenerator writeNull()
writeNull in interface JsonGeneratorpublic void close()
close in interface Closeableclose in interface AutoCloseableclose in interface JsonGeneratorpublic void flush()
flush in interface Flushableflush in interface JsonGeneratorpublic boolean isKeyNameEscaped()
public void setKeyNameEscaped(boolean b)
This is useful in certain situations where the same key names were repeatedly used. Such as exporting data to JSON from JDBC ResultSet.
b - true if the key name should be escaped. false otherwise.public int getBinaryFormat()
It is one of BinaryFormat.BINARY_FORMAT_BASE64 and
BinaryFormat.BINARY_FORMAT_HEX.
public void setBinaryFormat(int binaryFormat)
It is one of BinaryFormat.BINARY_FORMAT_BASE64 and
BinaryFormat.BINARY_FORMAT_HEX.
binaryFormat - the binary formatCopyright © 2016. All rights reserved.