oracle.dbtools.plugin.api.json.objects

## Interface JSONObjects

-     public interface JSONObjects

  API for creating in memory JSON Object representations, and for serializing in memory Object Graphs to JSON representations.
  Author:
    cdivilly

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `JSONArray.Builder` | `array()` Create a new `JSONArray.Builder` instance
    `JSONObject.Builder` | `object()` Create a new `JSONObject.Builder` instance
    `JSONNode` | `read(CharSequence text)` Parse a character stream into a `JSONObject` or `JSONArray` instance
    `JSONNode` | `read(InputStream stream)` Parse a byte stream into a `JSONObject` or `JSONArray` instance
    `JSONNode` | `read(Iterator<JSONToken> stream)` Parse a JSONToken stream into a `JSONObject` or `JSONArray` instance
    `JSONNode` | `read(Reader stream)` Parse a character stream into a `JSONObject` or `JSONArray` instance
    `void` | `write(Appendable stream, JSONNode node)` Serialize a JSON Object graph to it's textual representation
    `void` | `write(Appendable stream, Object objectGraph)` Serialize any Java Object graph to it's textual representation.
    `void` | `write(JSONWriter stream, JSONNode node)` Serialize a JSON Object graph to a `JSONWriter` stream
    `void` | `write(JSONWriter stream, Object objectGraph)` Serialize any Java Object graph to a `JSONWriter` stream.
    `void` | `write(OutputStream stream, JSONNode node)` Serialize a JSON Object graph to it's textual representation
    `void` | `write(OutputStream stream, Object objectGraph)` Serialize any Java Object graph to it's textual representation.

- - ### Method Detail

    - #### array

          JSONArray.Builder array()

      Create a new `JSONArray.Builder` instance
      Returns:
        `JSONArray.Builder` instance

    - #### object

          JSONObject.Builder object()

      Create a new `JSONObject.Builder` instance
      Returns:
        `JSONObject.Builder` instance

    - #### read

          JSONNode read(CharSequence text)

      Parse a character stream into a `JSONObject` or `JSONArray` instance
      Parameters:
        `text` - The JSON textual representation to be parsed
      Returns:
        `JSONObject` or `JSONArray` instance

    - #### read

          JSONNode read(InputStream stream)
                 throws JSONIOException

      Parse a byte stream into a `JSONObject` or `JSONArray` instance
      Parameters:
        `stream` - The JSON textual representation to be parsed
      Returns:
        `JSONObject` or `JSONArray` instance
      Throws:
        `JSONIOException` - if an `IOException` occurs reading from the stream

    - #### read

          JSONNode read(Iterator<JSONToken> stream)
                 throws JSONIOException

      Parse a JSONToken stream into a `JSONObject` or `JSONArray` instance
      Parameters:
        `stream` - The `JSONToken` stream to be parsed
      Returns:
        `JSONObject` or `JSONArray` instance
      Throws:
        `JSONIOException` - if an `IOException` occurs reading from the stream

    - #### read

          JSONNode read(Reader stream)
                 throws JSONIOException

      Parse a character stream into a `JSONObject` or `JSONArray` instance
      Parameters:
        `stream` - The JSON textual representation to be parsed
      Returns:
        `JSONObject` or `JSONArray` instance if an `IOException` occurs reading from the stream
      Throws:
        `JSONIOException`

    - #### write

          void write(Appendable stream,
                     JSONNode node)
              throws JSONIOException

      Serialize a JSON Object graph to it's textual representation
      Parameters:
        `stream` - The character stream to serialize to
        `node` - The `JSONObject` or `JSONNode` at the root of the object graph
      Throws:
        `JSONIOException` - if an IO error occurs

    - #### write

          void write(Appendable stream,
                     Object objectGraph)
              throws JSONIOException

      Serialize any Java Object graph to it's textual representation.

      Parameters:
        `stream` - The character stream to serialize to
        `objectGraph` - The root node in the object graph
      Throws:
        `JSONIOException` - if an IO error occurs
      See Also:
        Serializing Java Object Graphs

    - #### write

          void write(JSONWriter stream,
                     JSONNode node)
              throws JSONIOException

      Serialize a JSON Object graph to a `JSONWriter` stream
      Parameters:
        `stream` - The `JSONWriter` stream to serialize to
        `node` - The `JSONObject` or `JSONNode` at the root of the object graph
      Throws:
        `JSONIOException` - if an IO error occurs

    - #### write

          void write(JSONWriter stream,
                     Object objectGraph)
              throws JSONIOException

      Serialize any Java Object graph to a `JSONWriter` stream.

      Parameters:
        `stream` - The `JSONWriter` stream to serialize to
        `objectGraph` - The root node in the object graph
      Throws:
        `JSONIOException` - if an IO error occurs
      See Also:
        Serializing Java Object Graphs

    - #### write

          void write(OutputStream stream,
                     JSONNode node)
              throws JSONIOException

      Serialize a JSON Object graph to it's textual representation
      Parameters:
        `stream` - The byte stream to serialize to
        `node` - The `JSONObject` or `JSONNode` at the root of the object graph
      Throws:
        `JSONIOException` - if an IO error occurs

    - #### write

          void write(OutputStream stream,
                     Object objectGraph)
              throws JSONIOException

      Serialize any Java Object graph to it's textual representation.

      Parameters:
        `stream` - The byte stream to serialize to
        `objectGraph` - The root node in the object graph
      Throws:
        `JSONIOException` - if an IO error occurs
      See Also:
        Serializing Java Object Graphs

Copyright © 2010, 2022, Oracle and/or its affiliates.