Package jakarta.json.bind.serializer
Interface SerializationContext
public interface SerializationContext
Provides JSONB internals for custom serializers.
- Since:
- JSON Binding 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<T> void
serialize
(String key, T object, JsonGenerator generator) Serializes arbitrary object to JSON, using currentJsonGenerator
instance.<T> void
serialize
(T object, JsonGenerator generator) Serializes arbitrary object to JSON, using currentJsonGenerator
instance.
-
Method Details
-
serialize
Serializes arbitrary object to JSON, using currentJsonGenerator
instance. Serialization is ran as serialization of a root type from userJsonbSerializer
.JsonGenerator
instance is shared with JSONB and user serializer.- Type Parameters:
T
- Type of serialized object.- Parameters:
key
- JSON key name.object
- Object to serialize.generator
- JSONP generator to serialize with.
-
serialize
Serializes arbitrary object to JSON, using currentJsonGenerator
instance. Serialization is ran as serialization of a root type from userJsonbSerializer
.JsonGenerator
instance is shared with JSONB and user serializer. Method without key parameter is intended to serialize inside JSON_ARRAYs.- Type Parameters:
T
- Type of serialized object.- Parameters:
object
- Object to serialize.generator
- JSONP generator to serialize with.
-