Class MapSerializer<K,​V>

    • Method Detail

      • beforeSerialize

        protected void beforeSerialize​(Map<K,​V> obj)
        Check Map before serialization. Decide whether provided Map can be serialized as JsonObject or as JsonArray of map entries.
        Overrides:
        beforeSerialize in class AbstractContainerSerializer<Map<K,​V>>
        Parameters:
        obj - Map to be serialized
      • serializeInternal

        protected void serializeInternal​(Map<K,​V> obj,
                                         javax.json.stream.JsonGenerator generator,
                                         javax.json.bind.serializer.SerializationContext ctx)
        Serialize content of provided Map. Passing execution to delegate instance.
        Specified by:
        serializeInternal in class AbstractContainerSerializer<Map<K,​V>>
        Parameters:
        obj - Map to be serialized
        generator - JSON format generator
        ctx - JSON serialization context
      • writeStart

        protected void writeStart​(javax.json.stream.JsonGenerator generator)
        Write start of Map serialization. Passing execution to delegate instance.
        Specified by:
        writeStart in class AbstractContainerSerializer<Map<K,​V>>
        Parameters:
        generator - JSON format generator
      • writeStart

        protected void writeStart​(String key,
                                  javax.json.stream.JsonGenerator generator)
        Write start of Map serialization. Passing execution to delegate instance.
        Specified by:
        writeStart in class AbstractContainerSerializer<Map<K,​V>>
        Parameters:
        key - JSON key name
        generator - JSON format generator
      • writeEnd

        protected void writeEnd​(javax.json.stream.JsonGenerator generator)
        Write end of Map serialization. Passing execution to delegate instance.
        Overrides:
        writeEnd in class AbstractContainerSerializer<Map<K,​V>>
        Parameters:
        generator - JSON format generator
      • isNullable

        protected boolean isNullable()
        Return an information whether to serialize null values too.
        Returns:
        null values shall be serialized too when true