All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ppiech.auto.value.jackson.internal.objectmappers.MapMapper Maven / Gradle / Ivy

package com.ppiech.auto.value.jackson.internal.objectmappers;

import com.ppiech.auto.value.jackson.JsonMapper;
import com.ppiech.auto.value.jackson.LoganSquare;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;

import java.io.IOException;
import java.util.Map;

/**
 * Built-in mapper for Map objects of a unknown value types
 */
public class MapMapper extends JsonMapper> {

    @Override
    public Map parse(JsonParser jsonParser) throws IOException {
        return LoganSquare.mapperFor(Object.class).parseMap(jsonParser);
    }

    @Override
    public void parseField(Map instance, String fieldName, JsonParser jsonParser) throws IOException { }

    @Override
    public void serialize(Map map, JsonGenerator generator, boolean writeStartAndEnd) throws IOException {
        LoganSquare.mapperFor(Object.class).serialize(map, generator);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy