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 ofJsonReaderthat reads abyte[].createReader(InputStream json, JsonOptions options) Creates an instance ofJsonReaderthat reads aInputStream.createReader(Reader json, JsonOptions options) Creates an instance ofJsonReaderthat reads aReader.createReader(String json, JsonOptions options) Creates an instance ofJsonReaderthat reads aString.createWriter(OutputStream json, JsonOptions options) Creates an instance ofJsonWriterthat writes to anOutputStream.createWriter(Writer json, JsonOptions options) Creates an instance ofJsonWriterthat writes to anWriter.
-
Method Details
-
createReader
Creates an instance ofJsonReaderthat reads abyte[].- Parameters:
json- The JSON represented as abyte[].options-JsonOptionsto configure the creation of theJsonReader.- Returns:
- A new instance of
JsonReader. - Throws:
NullPointerException- Ifjsonoroptionsis null.IOException- If aJsonReadercannot be instantiated.
-
createReader
Creates an instance ofJsonReaderthat reads aString.- Parameters:
json- The JSON represented as aString.options-JsonOptionsto configure the creation of theJsonReader.- Returns:
- A new instance of
JsonReader. - Throws:
NullPointerException- Ifjsonoroptionsis null.IOException- If aJsonReadercannot be instantiated.
-
createReader
Creates an instance ofJsonReaderthat reads aInputStream.- Parameters:
json- The JSON represented as aInputStream.options-JsonOptionsto configure the creation of theJsonReader.- Returns:
- A new instance of
JsonReader. - Throws:
NullPointerException- Ifjsonoroptionsis null.IOException- If aJsonReadercannot be instantiated.
-
createReader
Creates an instance ofJsonReaderthat reads aReader.- Parameters:
json- The JSON represented as aReader.options-JsonOptionsto configure the creation of theJsonReader.- Returns:
- A new instance of
JsonReader. - Throws:
NullPointerException- Ifjsonoroptionsis null.IOException- If aJsonReadercannot be instantiated.
-
createWriter
Creates an instance ofJsonWriterthat writes to anOutputStream.- Parameters:
json- The JSON represented as anOutputStream.options-JsonOptionsto configure the creation of theJsonWriter.- Returns:
- A new instance of
JsonWriter. - Throws:
NullPointerException- Ifjsonoroptionsis null.IOException- If aJsonReadercannot be instantiated.
-
createWriter
Creates an instance ofJsonWriterthat writes to anWriter.- Parameters:
json- The JSON represented as anWriter.options-JsonOptionsto configure the creation of theJsonWriter.- Returns:
- A new instance of
JsonWriter. - Throws:
NullPointerException- Ifjsonoroptionsis null.IOException- If aJsonReadercannot be instantiated.
-