Interface SerializationContext


public interface SerializationContext
Provides JSONB internals for custom serializers.
Since:
JSON Binding 1.0
See Also:
  • Method Details

    • serialize

      <T> void serialize(String key, T object, JsonGenerator generator)
      Serializes arbitrary object to JSON, using current JsonGenerator instance. Serialization is ran as serialization of a root type from user JsonbSerializer. 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

      <T> void serialize(T object, JsonGenerator generator)
      Serializes arbitrary object to JSON, using current JsonGenerator instance. Serialization is ran as serialization of a root type from user JsonbSerializer. 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.