Interface IJsonWriter

All Known Implementing Classes:
CompositeJsonWriter, JsonWriter

public interface IJsonWriter
Interface describing a writer to write Json (JavaScript Object Notation) objects to a stream.
Since:
7.0
Author:
J. Gorter, Jon van Leuven
  • Method Details

    • writeObjectStart

      void writeObjectStart() throws IOException
      Begin appending an object.
      Throws:
      IOException - If an I/O error occurs.
    • writeObjectStart

      void writeObjectStart(String memberName) throws IOException
      Begin appending an object with a name.
      Parameters:
      memberName - The member name, may not be null or empty.
      Throws:
      IOException - If an I/O error occurs.
    • writeObjectEnd

      void writeObjectEnd() throws IOException
      End appending an object.
      Throws:
      IOException - If an I/O error occurs.
    • writeArrayStart

      void writeArrayStart() throws IOException
      Begin appending an array.
      Throws:
      IOException - If an I/O error occurs.
    • writeArrayStart

      void writeArrayStart(String memberName) throws IOException
      Begin appending an array with a name.
      Parameters:
      memberName - The member name, may not be null or empty.
      Throws:
      IOException - If an I/O error occurs.
    • writeArrayEnd

      void writeArrayEnd() throws IOException
      End appending an array.
      Throws:
      IOException - If an I/O error occurs.
    • writeMember

      void writeMember(String memberName, long longValue) throws IOException
      Append a member with a long value.
      Parameters:
      memberName - The member name, may not be null or empty.
      longValue - The value of the member.
      Throws:
      IOException - If an I/O error occurs.
    • writeMember

      void writeMember(String memberName) throws IOException
      Appending a member.
      Parameters:
      memberName - The member name, may not be null or empty.
      Throws:
      IOException - If an I/O error occurs.
    • writeMember

      void writeMember(String memberName, double doubleValue) throws IOException
      Append a member with a double value.
      Parameters:
      memberName - The member name, may not be null or empty.
      doubleValue - The value of the member.
      Throws:
      IOException - If an I/O error occurs.
      IllegalArgumentException - When the provided double value is NaN or Infinity.
    • writeMember

      void writeMember(String memberName, boolean booleanValue) throws IOException
      Append a member with a boolean value.
      Parameters:
      memberName - The member name, may not be null or empty.
      booleanValue - The value of the member.
      Throws:
      IOException - If an I/O error occurs.
    • writeMember

      void writeMember(String memberName, String strValue) throws IOException
      Append a member with a string value.
      Parameters:
      memberName - The member name, may not be null or empty.
      strValue - The value of the member.
      Throws:
      IOException - If an I/O error occurs.
    • writeNull

      void writeNull(String memberName) throws IOException
      Append a member with a null value.
      Parameters:
      memberName - The member name, may not be null or empty.
      Throws:
      IOException - If an I/O error occurs.
    • writeValue

      void writeValue(long longValue) throws IOException
      Append a long value.
      Parameters:
      longValue - The value.
      Throws:
      IOException - If an I/O error occurs.
    • writeValue

      void writeValue(double doubleValue) throws IOException
      Append a double value.
      Parameters:
      doubleValue - The value.
      Throws:
      IOException - If an I/O error occurs.
      IllegalArgumentException - When the provided double value is NaN or Infinity.
    • writeValue

      void writeValue(boolean booleanValue) throws IOException
      Append a boolean value.
      Parameters:
      booleanValue - The value.
      Throws:
      IOException - If an I/O error occurs.
    • writeValue

      void writeValue(String strValue) throws IOException
      Append a string value.
      Parameters:
      strValue - The value.
      Throws:
      IOException - If an I/O error occurs.
    • writeValueNull

      void writeValueNull() throws IOException
      Append a null value.
      Throws:
      IOException - If an I/O error occurs.
    • close

      void close() throws IOException
      Close this (and its internal) writer.
      Throws:
      IOException - If an I/O error occurs.