Class JsonWriterImpl
java.lang.Object
org.exoplatform.ws.frameworks.json.impl.JsonWriterImpl
- All Implemented Interfaces:
JsonWriter
- Version:
- $Id: JsonWriterImpl.java 34417 2009-07-23 14:42:56Z dkatayev $
- Author:
- Andrey Parfonov
-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
JsonWriterImpl
Constructs JsonWriter.- Parameters:
writer- Writer.
-
JsonWriterImpl
Constructs JsonWriter.- Parameters:
out- OutputStream.
-
-
Method Details
-
writeStartObject
Write the start of JSON object '{'.- Specified by:
writeStartObjectin interfaceJsonWriter- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeEndObject
Write the end of JSON object '}'.- Specified by:
writeEndObjectin interfaceJsonWriter- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeStartArray
Write the start of JSON array '['.- Specified by:
writeStartArrayin interfaceJsonWriter- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeEndArray
Write the end of JSON array ']'.- Specified by:
writeEndArrayin interfaceJsonWriter- 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.- Specified by:
writeKeyin interfaceJsonWriter- Parameters:
key- the key.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeString
Write the String to stream.- Specified by:
writeStringin interfaceJsonWriter- Parameters:
value- the String.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeValue
Write the value of long type to stream.- Specified by:
writeValuein interfaceJsonWriter- 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.- Specified by:
writeValuein interfaceJsonWriter- 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.- Specified by:
writeValuein interfaceJsonWriter- Parameters:
value- the value of boolean type.- Throws:
JsonException- if any errors, include i/o errors occurs.
-
writeNull
Write the null data to stream.- Specified by:
writeNullin interfaceJsonWriter- Throws:
JsonException- if any errors, include i/o errors occurs.
-
flush
Flush output writer.- Specified by:
flushin interfaceJsonWriter- Throws:
JsonException- if any errors, include i/o errors occurs.
-
close
Close output writer.- Specified by:
closein interfaceJsonWriter- Throws:
JsonException- if any errors, include i/o errors occurs.
-