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
Modifier and TypeMethodDescriptionvoidclose()Close output writer.voidflush()Flush output writer.voidWrite the end of JSON array ']'.voidWrite the end of JSON object '}'.voidWrite the key.voidWrite the null data to stream.voidWrite the start of JSON array '['.voidWrite 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 Details
-
writeStartObject
Write the start of JSON object '{'.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeEndObject
Write the end of JSON object '}'.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeStartArray
Write the start of JSON array '['.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeKey
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
Write the end of JSON array ']'.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeString
Write the String to stream.- Parameters:
value- the String.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeValue
Write 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
Write 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
Write 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
Write the null data to stream.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
flush
Flush output writer.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
close
Close output writer.- Throws:
JsonException- if any errors, include i/o errors occurs.
-