org.exoplatform.ws.frameworks.json
Interface JsonWriter

All Known Implementing Classes:
JsonWriterImpl

public interface JsonWriter

Version:
$Id: $
Author:
Andrey Parfonov

Method Summary
 void close()
          Close output writer.
 void flush()
          Flush output writer.
 void writeEndArray()
          Write the end of JSON array ']'.
 void writeEndObject()
          Write the end of JSON object '}'.
 void writeKey(String key)
          Write the key.
 void writeNull()
          Write the null data to stream.
 void writeStartArray()
          Write the start of JSON array '['.
 void writeStartObject()
          Write the start of JSON object '{'.
 void writeString(String value)
          Write the String to stream.
 void writeValue(boolean value)
          Write the value of boolean type to stream.
 void writeValue(double value)
          Write the value of double type to stream.
 void writeValue(long value)
          Write the value of long type to stream.
 

Method Detail

writeStartObject

void writeStartObject()
                      throws JsonException
Write the start of JSON object '{'.

Throws:
JsonException - if any errors, include i/o errors occurs.

writeEndObject

void writeEndObject()
                    throws JsonException
Write the end of JSON object '}'.

Throws:
JsonException - if any errors, include i/o errors occurs.

writeStartArray

void writeStartArray()
                     throws JsonException
Write 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 JsonException
Write 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 JsonException
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

void writeValue(double value)
                throws JsonException
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

void writeValue(boolean value)
                throws JsonException
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

void writeNull()
               throws JsonException
Write the null data to stream.

Throws:
JsonException - if any errors, include i/o errors occurs.

flush

void flush()
           throws JsonException
Flush output writer.

Throws:
JsonException - if any errors, include i/o errors occurs.

close

void close()
           throws JsonException
Close output writer.

Throws:
JsonException - if any errors, include i/o errors occurs.


Copyright © 2009 eXo Platform SAS. All Rights Reserved.