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 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.