Class JsonProcessing


  • public final class JsonProcessing
    extends Object
    Support for json processing integration.
    • Method Detail

      • reader

        public Reader<javax.json.JsonStructure> reader()
        Returns a function (reader) converting Publisher of ByteBuffers to a JSON-P object.

        It is intended for derivation of others, more specific readers.

        Returns:
        the byte array content reader that transforms a publisher of byte buffers to a completion stage that might end exceptionally with a IllegalArgumentException in case of I/O error or a JsonException
      • reader

        public Reader<javax.json.JsonStructure> reader​(Charset charset)
        Returns a function (reader) converting Publisher of ByteBuffers to a JSON-P object.

        It is intended for derivation of others, more specific readers.

        Parameters:
        charset - a charset to use charset
        Returns:
        the byte array content reader that transforms a publisher of byte buffers to a completion stage that might end exceptionally with a IllegalArgumentException in case of I/O error or a JsonException
      • writer

        public Function<javax.json.JsonStructure,​Flow.Publisher<DataChunk>> writer​(Charset charset)
        Returns a function (writer) converting JsonStructure to the Publisher of DataChunks.
        Parameters:
        charset - a charset to use or null for default charset
        Returns:
        created function
      • create

        public static JsonProcessing create()
        Provides a default instance for JSON-P readers and writers.
        Returns:
        json processing with default configuration
      • create

        public static JsonProcessing create​(Map<String,​?> jsonPConfig)
        Create an instance with the provided JSON-P configuration.
        Parameters:
        jsonPConfig - configuration of the processing library
        Returns:
        a configured JSON-P instance
      • builder

        public static JsonProcessing.Builder builder()
        Fluent API builder to create instances of JSON-P.
        Returns:
        a new builder instance