JsonProvider Interface

public interface JsonProvider

An interface to be implemented by any azure-json plugin that wishes to provide an alternate JsonReader or JsonWriter implementation.

Method Summary

Modifier and Type Method and Description
abstract JsonReader createReader(byte[] json, JsonOptions options)

Creates an instance of JsonReader that reads a byte[].

abstract JsonReader createReader(InputStream json, JsonOptions options)

Creates an instance of JsonReader that reads a InputStream.

abstract JsonReader createReader(Reader json, JsonOptions options)

Creates an instance of JsonReader that reads a Reader.

abstract JsonReader createReader(String json, JsonOptions options)

Creates an instance of JsonReader that reads a String.

abstract JsonWriter createWriter(OutputStream json, JsonOptions options)

Creates an instance of JsonWriter that writes to an OutputStream.

abstract JsonWriter createWriter(Writer json, JsonOptions options)

Creates an instance of JsonWriter that writes to an Writer.

Method Details

createReader

public abstract JsonReader createReader(byte[] json, JsonOptions options)

Creates an instance of JsonReader that reads a byte[].

Parameters:

json - The JSON represented as a byte[].
options - JsonOptions to configure the creation of the JsonReader.

Returns:

A new instance of JsonReader.

Throws:

IOException

- If json or options is null.

createReader

public abstract JsonReader createReader(InputStream json, JsonOptions options)

Creates an instance of JsonReader that reads a InputStream.

Parameters:

json - The JSON represented as a InputStream.
options - JsonOptions to configure the creation of the JsonReader.

Returns:

A new instance of JsonReader.

Throws:

IOException

- If json or options is null.

createReader

public abstract JsonReader createReader(Reader json, JsonOptions options)

Creates an instance of JsonReader that reads a Reader.

Parameters:

json - The JSON represented as a Reader.
options - JsonOptions to configure the creation of the JsonReader.

Returns:

A new instance of JsonReader.

Throws:

IOException

- If json or options is null.

createReader

public abstract JsonReader createReader(String json, JsonOptions options)

Creates an instance of JsonReader that reads a String.

Parameters:

json - The JSON represented as a String.
options - JsonOptions to configure the creation of the JsonReader.

Returns:

A new instance of JsonReader.

Throws:

IOException

- If json or options is null.

createWriter

public abstract JsonWriter createWriter(OutputStream json, JsonOptions options)

Creates an instance of JsonWriter that writes to an OutputStream.

Parameters:

json - The JSON represented as an OutputStream.
options - JsonOptions to configure the creation of the JsonWriter.

Returns:

A new instance of JsonWriter.

Throws:

IOException

- If json or options is null.

createWriter

public abstract JsonWriter createWriter(Writer json, JsonOptions options)

Creates an instance of JsonWriter that writes to an Writer.

Parameters:

json - The JSON represented as an Writer.
options - JsonOptions to configure the creation of the JsonWriter.

Returns:

A new instance of JsonWriter.

Throws:

IOException

- If json or options is null.

Applies to