Package io.sentry
Class JsonSerializer
java.lang.Object
io.sentry.JsonSerializer
- All Implemented Interfaces:
ISerializer
The serializer class that uses manual JSON parsing with the help of vendored GSON reader/writer
classes.
-
Constructor Summary
ConstructorDescriptionJsonSerializer
(@NotNull SentryOptions options) All our custom deserializers need to be registered to be used with the deserializer instance. -
Method Summary
Modifier and TypeMethodDescription<T> T
deserialize
(@NotNull Reader reader, @NotNull Class<T> clazz) <T,
R> T deserializeCollection
(@NotNull Reader reader, @NotNull Class<T> clazz, @Nullable JsonDeserializer<R> elementDeserializer) @Nullable SentryEnvelope
deserializeEnvelope
(@NotNull InputStream inputStream) void
serialize
(@NotNull SentryEnvelope envelope, @NotNull OutputStream outputStream) Serializes an envelope to an OutputStream@NotNull String
<T> void
-
Constructor Details
-
JsonSerializer
All our custom deserializers need to be registered to be used with the deserializer instance. *
-
-
Method Details
-
deserializeCollection
@Nullable public <T,R> T deserializeCollection(@NotNull @NotNull Reader reader, @NotNull @NotNull Class<T> clazz, @Nullable @Nullable JsonDeserializer<R> elementDeserializer) - Specified by:
deserializeCollection
in interfaceISerializer
-
deserialize
@Nullable public <T> T deserialize(@NotNull @NotNull Reader reader, @NotNull @NotNull Class<T> clazz) - Specified by:
deserialize
in interfaceISerializer
-
deserializeEnvelope
@Nullable public @Nullable SentryEnvelope deserializeEnvelope(@NotNull @NotNull InputStream inputStream) - Specified by:
deserializeEnvelope
in interfaceISerializer
-
serialize
- Specified by:
serialize
in interfaceISerializer
- Throws:
IOException
-
serialize
public void serialize(@NotNull @NotNull SentryEnvelope envelope, @NotNull @NotNull OutputStream outputStream) throws Exception Serializes an envelope to an OutputStream- Specified by:
serialize
in interfaceISerializer
- Parameters:
envelope
- the envelopeoutputStream
- will not be closed automatically- Throws:
Exception
- an exception
-
serialize
@NotNull public @NotNull String serialize(@NotNull @NotNull Map<String, Object> data) throws Exception- Specified by:
serialize
in interfaceISerializer
- Throws:
Exception
-