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

io.robe.convert.json.JSONExporter Maven / Gradle / Ivy

There is a newer version: 0.5.0.0-1039
Show newest version
package io.robe.convert.json;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.robe.convert.common.Exporter;

import java.io.IOException;
import java.io.OutputStream;
import java.util.Iterator;


public class JSONExporter extends Exporter {

    public JSONExporter(Class dataClass) {
        super(dataClass);
    }

    @Override
    public void exportStream(OutputStream outputStream, Iterator iterator) throws IOException, ClassNotFoundException, IllegalAccessException {
        ObjectMapper mapper = new ObjectMapper();
        mapper.writeValue(outputStream, iterator);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy