Interface JsonDocumentWriter

All Known Implementing Classes:
OsonDocumentWriter, StringJsonDocumentWriter

public interface JsonDocumentWriter
JSON document producer. Implementation of this inteface will used to build a JSON document. Implementation example is StringJsonDocumentWriter
  • Method Details

    • startObject

      JsonDocumentWriter startObject()
      Starts a new JSON Objects.
      Returns:
      this instance
    • endObject

      JsonDocumentWriter endObject()
      Ends a new JSON Objects
      Returns:
      this instance
    • startArray

      JsonDocumentWriter startArray()
      Starts a new JSON array.
      Returns:
      this instance
      Throws:
      IOException - an I/O error roccured while starting the object.
    • endArray

      JsonDocumentWriter endArray()
      Ends a new JSON array.
      Returns:
      this instance
      Throws:
      IOException - an I/O error roccured while starting the object.
    • objectKey

      JsonDocumentWriter objectKey(String key)
      Adds a new JSON element name.
      Parameters:
      key - the element name.
      Returns:
      this instance
      Throws:
      IllegalArgumentException - key name does not follow JSON specification.
      IOException - an I/O error occurred while starting the object.
    • nullValue

      JsonDocumentWriter nullValue()
      Adds a new JSON element null value.
      Returns:
      this instance
      Throws:
      IOException - an I/O error roccured while starting the object.
    • numericValue

      JsonDocumentWriter numericValue(Number value)
      Adds a new JSON element numeric value.
      Parameters:
      value - the element numeric name.
      Returns:
      this instance
    • booleanValue

      JsonDocumentWriter booleanValue(boolean value)
      Adds a new JSON element boolean value.
      Parameters:
      value - the element boolean name.
      Returns:
      this instance
    • stringValue

      JsonDocumentWriter stringValue(String value)
      Adds a new JSON element string value.
      Parameters:
      value - the element string name.
      Returns:
      this instance
    • serializeJsonValue

      <T> JsonDocumentWriter serializeJsonValue(Object value, JavaType<T> javaType, JdbcType jdbcType, WrapperOptions options)
      Adds a JSON value to the document
      Parameters:
      value - the value to be serialized
      javaType - the Java type of the value
      jdbcType - the JDBC type for the value to be serialized
      options - the wrapping options
      Returns:
      this instance