Class JacksonJsonSerializer
java.lang.Object
com.azure.core.serializer.json.jackson.JacksonJsonSerializer
- All Implemented Interfaces:
JsonSerializer,MemberNameConverter,ObjectSerializer
public final class JacksonJsonSerializer
extends Object
implements JsonSerializer, MemberNameConverter
Jackson based implementation of the
JsonSerializer and MemberNameConverter interfaces.-
Method Summary
Modifier and TypeMethodDescriptionconvertMemberName(Member member) Attempts to get the JSON serialized property name from the passedMember.<T> Tdeserialize(InputStream stream, TypeReference<T> typeReference) Reads a JSON stream into its object representation.<T> Mono<T>deserializeAsync(InputStream stream, TypeReference<T> typeReference) Reads a JSON stream into its object representation.<T> TdeserializeFromBytes(byte[] data, TypeReference<T> typeReference) Reads a JSON byte array into its object representation.<T> Mono<T>deserializeFromBytesAsync(byte[] data, TypeReference<T> typeReference) Reads a JSON byte array into its object representation.voidserialize(OutputStream stream, Object value) Writes an object's JSON representation into a stream.serializeAsync(OutputStream stream, Object value) Writes an object's JSON representation into a stream.byte[]serializeToBytes(Object value) Converts the object into a JSON byte array.Mono<byte[]>serializeToBytesAsync(Object value) Converts the object into a JSON byte array.
-
Method Details
-
deserializeFromBytes
Description copied from interface:JsonSerializerReads a JSON byte array into its object representation.- Specified by:
deserializeFromBytesin interfaceJsonSerializer- Specified by:
deserializeFromBytesin interfaceObjectSerializer- Type Parameters:
T- Type of the object.- Parameters:
data- JSON byte array.typeReference-TypeReferencerepresenting the object.- Returns:
- The object represented by the deserialized JSON byte array.
-
deserialize
Description copied from interface:JsonSerializerReads a JSON stream into its object representation.- Specified by:
deserializein interfaceJsonSerializer- Specified by:
deserializein interfaceObjectSerializer- Type Parameters:
T- Type of the object.- Parameters:
stream- JSON stream.typeReference-TypeReferencerepresenting the object.- Returns:
- The object represented by the deserialized JSON stream.
-
deserializeFromBytesAsync
Description copied from interface:JsonSerializerReads a JSON byte array into its object representation.- Specified by:
deserializeFromBytesAsyncin interfaceJsonSerializer- Specified by:
deserializeFromBytesAsyncin interfaceObjectSerializer- Type Parameters:
T- Type of the object.- Parameters:
data- JSON byte array.typeReference-TypeReferencerepresenting the object.- Returns:
- Reactive stream that emits the object represented by the deserialized JSON byte array.
-
deserializeAsync
Description copied from interface:JsonSerializerReads a JSON stream into its object representation.- Specified by:
deserializeAsyncin interfaceJsonSerializer- Specified by:
deserializeAsyncin interfaceObjectSerializer- Type Parameters:
T- Type of the object.- Parameters:
stream- JSON stream.typeReference-TypeReferencerepresenting the object.- Returns:
- Reactive stream that emits the object represented by the deserialized JSON stream.
-
serializeToBytes
Description copied from interface:JsonSerializerConverts the object into a JSON byte array.- Specified by:
serializeToBytesin interfaceJsonSerializer- Specified by:
serializeToBytesin interfaceObjectSerializer- Parameters:
value- The object.- Returns:
- The JSON binary representation of the serialized object.
-
serialize
Description copied from interface:JsonSerializerWrites an object's JSON representation into a stream.- Specified by:
serializein interfaceJsonSerializer- Specified by:
serializein interfaceObjectSerializer- Parameters:
stream-OutputStreamwhere the object's JSON representation will be written.value- The object.
-
serializeToBytesAsync
Description copied from interface:JsonSerializerConverts the object into a JSON byte array.- Specified by:
serializeToBytesAsyncin interfaceJsonSerializer- Specified by:
serializeToBytesAsyncin interfaceObjectSerializer- Parameters:
value- The object.- Returns:
- Reactive stream that emits the JSON binary representation of the serialized object.
-
serializeAsync
Description copied from interface:JsonSerializerWrites an object's JSON representation into a stream.- Specified by:
serializeAsyncin interfaceJsonSerializer- Specified by:
serializeAsyncin interfaceObjectSerializer- Parameters:
stream-OutputStreamwhere the object's JSON representation will be written.value- The object.- Returns:
- Reactive stream that will indicate operation completion.
-
convertMemberName
Description copied from interface:MemberNameConverterAttempts to get the JSON serialized property name from the passedMember.If a
ConstructororExecutableis passednullwill be returned.- Specified by:
convertMemberNamein interfaceMemberNameConverter- Parameters:
member- TheMemberthat will have its JSON serialized property name retrieved.- Returns:
- The JSON property name for the
Member.
-