Package com.azure.core.util.serializer
Class JsonSerializerProviders
java.lang.Object
com.azure.core.util.serializer.JsonSerializerProviders
This class is a proxy for using a
JsonSerializerProvider loaded from the classpath.-
Method Summary
Modifier and TypeMethodDescriptionstatic JsonSerializerCreates an instance ofJsonSerializerusing the firstJsonSerializerProviderfound in the classpath.static JsonSerializercreateInstance(boolean useDefaultIfAbsent) Creates an instance ofJsonSerializerusing the firstJsonSerializerProviderfound in the classpath.
-
Method Details
-
createInstance
Creates an instance ofJsonSerializerusing the firstJsonSerializerProviderfound in the classpath.- Returns:
- A new instance of
JsonSerializer. - Throws:
IllegalStateException- if aJsonSerializerProvideris not found in the classpath.
-
createInstance
Creates an instance ofJsonSerializerusing the firstJsonSerializerProviderfound in the classpath. If no provider is found in classpath, a default provider will be included ifuseDefaultIfAbsentis set to true.- Parameters:
useDefaultIfAbsent- If no provider is found in classpath, a default provider will be used. ifuseDefaultIfAbsentis set to true.- Returns:
- A new instance of
JsonSerializer. - Throws:
IllegalStateException- if aJsonSerializerProvideris not found in the classpath anduseDefaultIfAbsentis set to false.
-