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