Class MapEntriesArrayDeserializer<K,​V>

java.lang.Object
org.eclipse.yasson.internal.serializer.AbstractItem<Map<K,​V>>
org.eclipse.yasson.internal.serializer.MapEntriesArrayDeserializer<K,​V>
Type Parameters:
K - Map key type to serialize
V - Map value type to serialize
All Implemented Interfaces:
javax.json.bind.serializer.JsonbDeserializer<Map<K,​V>>, RuntimeTypeInfo, CurrentItem<Map<K,​V>>

public class MapEntriesArrayDeserializer<K,​V> extends AbstractItem<Map<K,​V>> implements javax.json.bind.serializer.JsonbDeserializer<Map<K,​V>>
De-serialize JSON array of map entries JSON objects as Map. JSON array of map entries JSON objects:
 [
     {
         "key": JsonValue,
         "value": JsonValue
     }, ...
 ]
 
  • Method Details

    • deserialize

      public Map<K,​V> deserialize(javax.json.stream.JsonParser parser, javax.json.bind.serializer.DeserializationContext context, Type rtType)
      De-serialize container stored as JSON structure. Reads JSON tokens from JSON parser and calls corresponding handler method for each of the tokens. Implementing class shall process those tokens and build container instance of T to be returned.
      Specified by:
      deserialize in interface javax.json.bind.serializer.JsonbDeserializer<K>
      Parameters:
      parser - JSON parser
      context - de-serialization context
      rtType - type of returned instance
      Returns:
      Map instance with content of source JSON structure
    • startArray

      public void startArray(org.eclipse.yasson.internal.serializer.MapEntriesArrayDeserializer.Context ctx, javax.json.stream.JsonParser.Event event)
      De-serialize JSON structure following beginning of JSON Array ('[').
      Parameters:
      ctx - parser context
      event - JSON parser token (event)