Interface JsonWriter
-
- All Known Implementing Classes:
JsonWriterImpl
public interface JsonWriter- Version:
- $Id: JsonWriter.java 34417 2009-07-23 14:42:56Z dkatayev $
- Author:
- Andrey Parfonov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close output writer.voidflush()Flush output writer.voidwriteEndArray()Write the end of JSON array ']'.voidwriteEndObject()Write the end of JSON object '}'.voidwriteKey(String key)Write the key.voidwriteNull()Write the null data to stream.voidwriteStartArray()Write the start of JSON array '['.voidwriteStartObject()Write the start of JSON object '{'.voidwriteString(String value)Write the String to stream.voidwriteValue(boolean value)Write the value of boolean type to stream.voidwriteValue(double value)Write the value of double type to stream.voidwriteValue(long value)Write the value of long type to stream.
-
-
-
Method Detail
-
writeStartObject
void writeStartObject() throws JsonExceptionWrite the start of JSON object '{'.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeEndObject
void writeEndObject() throws JsonExceptionWrite the end of JSON object '}'.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeStartArray
void writeStartArray() throws JsonExceptionWrite the start of JSON array '['.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeKey
void writeKey(String key) throws JsonException
Write the key. After key will go the value. In this way data represented in JSON object.- Parameters:
key- the key.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeEndArray
void writeEndArray() throws JsonExceptionWrite the end of JSON array ']'.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeString
void writeString(String value) throws JsonException
Write the String to stream.- Parameters:
value- the String.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeValue
void writeValue(long value) throws JsonExceptionWrite the value of long type to stream.- Parameters:
value- the value of long type.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeValue
void writeValue(double value) throws JsonExceptionWrite the value of double type to stream.- Parameters:
value- the value of double type.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeValue
void writeValue(boolean value) throws JsonExceptionWrite the value of boolean type to stream.- Parameters:
value- the value of boolean type.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeNull
void writeNull() throws JsonExceptionWrite the null data to stream.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
flush
void flush() throws JsonExceptionFlush output writer.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
close
void close() throws JsonExceptionClose output writer.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
-