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

com.fordfrog.xml2csv.DefaultCsvWriter Maven / Gradle / Ivy

Go to download

Forked version of fordfrog xml2csv library that allows selection of xml elements via attributes

The newest version!
package com.fordfrog.xml2csv;

import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;

public class DefaultCsvWriter implements LineHandler {

    private final Writer writer;

    public DefaultCsvWriter() {
        this(new StringWriter());
    }

    public DefaultCsvWriter(Writer writer) {
        this.writer = writer;
    }

    @Override
    public void handler(String line) {
        try {
            writer.append(line);
            writer.append(System.lineSeparator());
        } catch (IOException e) {
            throw new Xml2CsvException(e);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy