JsonProviders Class
- java.
lang. Object - com.
azure. json. JsonProviders
- com.
public final class JsonProviders
Utility class for JsonProvider that will use the implementation of JsonProvider found on the classpath to create instances of JsonReader or JsonWriter.
If no implementation of JsonProvider is found on the classpath a default implementation provided by this library will be used.
At this time, additional implementations of JsonProvider found on the classpath after the first will cause an IllegalStateException to be thrown. Ensure the implementation that should be used is the only one listed in META-INF/services/com.azure.json.JsonProvider
of your JAR.
Method Summary
Modifier and Type | Method and Description |
---|---|
static
Json |
createReader(byte[] json)
Creates an instance of JsonReader that reads a |
static
Json |
createReader(byte[] json, JsonOptions options)
Creates an instance of JsonReader that reads a |
static
Json |
createReader(InputStream json)
Creates an instance of JsonReader that reads a InputStream. |
static
Json |
createReader(InputStream json, JsonOptions options)
Creates an instance of JsonReader that reads a InputStream. |
static
Json |
createReader(Reader json)
Creates an instance of JsonReader that reads a Reader. |
static
Json |
createReader(Reader json, JsonOptions options)
Creates an instance of JsonReader that reads a Reader. |
static
Json |
createReader(String json)
Creates an instance of JsonReader that reads a String. |
static
Json |
createReader(String json, JsonOptions options)
Creates an instance of JsonReader that reads a String. |
static
Json |
createWriter(OutputStream json)
Creates an instance of JsonWriter that writes to an OutputStream. |
static
Json |
createWriter(OutputStream json, JsonOptions options)
Creates an instance of JsonWriter that writes to an OutputStream. |
static
Json |
createWriter(Writer json)
Creates an instance of JsonWriter that writes to an Writer. |
static
Json |
createWriter(Writer json, JsonOptions options)
Creates an instance of JsonWriter that writes to an Writer. |
Methods inherited from java.lang.Object
Method Details
createReader
public static JsonReader createReader(byte[] json)
Creates an instance of JsonReader that reads a byte[]
.
If a provider could not be found on the classpath this will use the default implementation, effectively the equivalent to createReader(byte[] json, JsonOptions options).
Parameters:
byte[]
.
Returns:
Throws:
json
is null.
createReader
public static JsonReader createReader(byte[] json, JsonOptions options)
Creates an instance of JsonReader that reads a byte[]
.
Parameters:
byte[]
.
Returns:
Throws:
createReader
public static JsonReader createReader(InputStream json)
Creates an instance of JsonReader that reads a InputStream.
If a provider could not be found on the classpath this will use the default implementation, effectively the equivalent to createReader(InputStream json, JsonOptions options).
Parameters:
Returns:
Throws:
json
is null.
createReader
public static JsonReader createReader(InputStream json, JsonOptions options)
Creates an instance of JsonReader that reads a InputStream.
Parameters:
Returns:
Throws:
createReader
public static JsonReader createReader(Reader json)
Creates an instance of JsonReader that reads a Reader.
If a provider could not be found on the classpath this will use the default implementation, effectively the equivalent to createReader(Reader json, JsonOptions options).
Parameters:
Returns:
Throws:
json
is null.
createReader
public static JsonReader createReader(Reader json, JsonOptions options)
Creates an instance of JsonReader that reads a Reader.
Parameters:
Returns:
Throws:
createReader
public static JsonReader createReader(String json)
Creates an instance of JsonReader that reads a String.
If a provider could not be found on the classpath this will use the default implementation, effectively the equivalent to createReader(String json, JsonOptions options).
Parameters:
Returns:
Throws:
json
is null.
createReader
public static JsonReader createReader(String json, JsonOptions options)
Creates an instance of JsonReader that reads a String.
Parameters:
Returns:
Throws:
createWriter
public static JsonWriter createWriter(OutputStream json)
Creates an instance of JsonWriter that writes to an OutputStream.
If a provider could not be found on the classpath this will use the default implementation, effectively the equivalent to createWriter(OutputStream json, JsonOptions options).
Parameters:
Returns:
Throws:
json
is null.
createWriter
public static JsonWriter createWriter(OutputStream json, JsonOptions options)
Creates an instance of JsonWriter that writes to an OutputStream.
Parameters:
Returns:
Throws:
createWriter
public static JsonWriter createWriter(Writer json)
Creates an instance of JsonWriter that writes to an Writer.
If a provider could not be found on the classpath this will use the default implementation, effectively the equivalent to createWriter(Writer json, JsonOptions options).
Parameters:
Returns:
Throws:
json
is null.
createWriter
public static JsonWriter createWriter(Writer json, JsonOptions options)
Creates an instance of JsonWriter that writes to an Writer.
Parameters:
Returns:
Throws:
Applies to
Azure SDK for Java