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> T
deserialize
(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> T
deserializeFromBytes
(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.void
serialize
(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:JsonSerializer
Reads a JSON byte array into its object representation.- Specified by:
deserializeFromBytes
in interfaceJsonSerializer
- Specified by:
deserializeFromBytes
in interfaceObjectSerializer
- Type Parameters:
T
- Type of the object.- Parameters:
data
- JSON byte array.typeReference
-TypeReference
representing the object.- Returns:
- The object represented by the deserialized JSON byte array.
-
deserialize
Description copied from interface:JsonSerializer
Reads a JSON stream into its object representation.- Specified by:
deserialize
in interfaceJsonSerializer
- Specified by:
deserialize
in interfaceObjectSerializer
- Type Parameters:
T
- Type of the object.- Parameters:
stream
- JSON stream.typeReference
-TypeReference
representing the object.- Returns:
- The object represented by the deserialized JSON stream.
-
deserializeFromBytesAsync
Description copied from interface:JsonSerializer
Reads a JSON byte array into its object representation.- Specified by:
deserializeFromBytesAsync
in interfaceJsonSerializer
- Specified by:
deserializeFromBytesAsync
in interfaceObjectSerializer
- Type Parameters:
T
- Type of the object.- Parameters:
data
- JSON byte array.typeReference
-TypeReference
representing the object.- Returns:
- Reactive stream that emits the object represented by the deserialized JSON byte array.
-
deserializeAsync
Description copied from interface:JsonSerializer
Reads a JSON stream into its object representation.- Specified by:
deserializeAsync
in interfaceJsonSerializer
- Specified by:
deserializeAsync
in interfaceObjectSerializer
- Type Parameters:
T
- Type of the object.- Parameters:
stream
- JSON stream.typeReference
-TypeReference
representing the object.- Returns:
- Reactive stream that emits the object represented by the deserialized JSON stream.
-
serializeToBytes
Description copied from interface:JsonSerializer
Converts the object into a JSON byte array.- Specified by:
serializeToBytes
in interfaceJsonSerializer
- Specified by:
serializeToBytes
in interfaceObjectSerializer
- Parameters:
value
- The object.- Returns:
- The JSON binary representation of the serialized object.
-
serialize
Description copied from interface:JsonSerializer
Writes an object's JSON representation into a stream.- Specified by:
serialize
in interfaceJsonSerializer
- Specified by:
serialize
in interfaceObjectSerializer
- Parameters:
stream
-OutputStream
where the object's JSON representation will be written.value
- The object.
-
serializeToBytesAsync
Description copied from interface:JsonSerializer
Converts the object into a JSON byte array.- Specified by:
serializeToBytesAsync
in interfaceJsonSerializer
- Specified by:
serializeToBytesAsync
in interfaceObjectSerializer
- Parameters:
value
- The object.- Returns:
- Reactive stream that emits the JSON binary representation of the serialized object.
-
serializeAsync
Description copied from interface:JsonSerializer
Writes an object's JSON representation into a stream.- Specified by:
serializeAsync
in interfaceJsonSerializer
- Specified by:
serializeAsync
in interfaceObjectSerializer
- Parameters:
stream
-OutputStream
where the object's JSON representation will be written.value
- The object.- Returns:
- Reactive stream that will indicate operation completion.
-
convertMemberName
Description copied from interface:MemberNameConverter
Attempts to get the JSON serialized property name from the passedMember
.If a
Constructor
orExecutable
is passednull
will be returned.- Specified by:
convertMemberName
in interfaceMemberNameConverter
- Parameters:
member
- TheMember
that will have its JSON serialized property name retrieved.- Returns:
- The JSON property name for the
Member
.
-