Package com.azure.json
Interface JsonProvider
public interface JsonProvider
An interface to be implemented by any azure-json plugin that wishes to provide an alternate
JsonReader
or
JsonWriter
implementation.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateReader
(byte[] json, JsonOptions options) Creates an instance ofJsonReader
that reads abyte[]
.createReader
(InputStream json, JsonOptions options) Creates an instance ofJsonReader
that reads aInputStream
.createReader
(Reader json, JsonOptions options) Creates an instance ofJsonReader
that reads aReader
.createReader
(String json, JsonOptions options) Creates an instance ofJsonReader
that reads aString
.createWriter
(OutputStream json, JsonOptions options) Creates an instance ofJsonWriter
that writes to anOutputStream
.createWriter
(Writer json, JsonOptions options) Creates an instance ofJsonWriter
that writes to anWriter
.
-
Method Details
-
createReader
Creates an instance ofJsonReader
that reads abyte[]
.- Parameters:
json
- The JSON represented as abyte[]
.options
-JsonOptions
to configure the creation of theJsonReader
.- Returns:
- A new instance of
JsonReader
. - Throws:
NullPointerException
- Ifjson
oroptions
is null.IOException
- If aJsonReader
cannot be instantiated.
-
createReader
Creates an instance ofJsonReader
that reads aString
.- Parameters:
json
- The JSON represented as aString
.options
-JsonOptions
to configure the creation of theJsonReader
.- Returns:
- A new instance of
JsonReader
. - Throws:
NullPointerException
- Ifjson
oroptions
is null.IOException
- If aJsonReader
cannot be instantiated.
-
createReader
Creates an instance ofJsonReader
that reads aInputStream
.- Parameters:
json
- The JSON represented as aInputStream
.options
-JsonOptions
to configure the creation of theJsonReader
.- Returns:
- A new instance of
JsonReader
. - Throws:
NullPointerException
- Ifjson
oroptions
is null.IOException
- If aJsonReader
cannot be instantiated.
-
createReader
Creates an instance ofJsonReader
that reads aReader
.- Parameters:
json
- The JSON represented as aReader
.options
-JsonOptions
to configure the creation of theJsonReader
.- Returns:
- A new instance of
JsonReader
. - Throws:
NullPointerException
- Ifjson
oroptions
is null.IOException
- If aJsonReader
cannot be instantiated.
-
createWriter
Creates an instance ofJsonWriter
that writes to anOutputStream
.- Parameters:
json
- The JSON represented as anOutputStream
.options
-JsonOptions
to configure the creation of theJsonWriter
.- Returns:
- A new instance of
JsonWriter
. - Throws:
NullPointerException
- Ifjson
oroptions
is null.IOException
- If aJsonReader
cannot be instantiated.
-
createWriter
Creates an instance ofJsonWriter
that writes to anWriter
.- Parameters:
json
- The JSON represented as anWriter
.options
-JsonOptions
to configure the creation of theJsonWriter
.- Returns:
- A new instance of
JsonWriter
. - Throws:
NullPointerException
- Ifjson
oroptions
is null.IOException
- If aJsonReader
cannot be instantiated.
-