Search in sources :

Example 1 with FixedWidthWriter

use of com.univocity.parsers.fixed.FixedWidthWriter in project powsybl-core by powsybl.

the class IeeeCdfWriter method writeRecords.

private static <T> void writeRecords(Writer writer, List<T> beans, Class<T> aClass) {
    FixedWidthWriterSettings settings = new FixedWidthWriterSettings();
    settings.setWriteLineSeparatorAfterRecord(true);
    BeanWriterProcessor<T> processor = new BeanWriterProcessor<>(aClass);
    settings.setRowWriterProcessor(processor);
    new FixedWidthWriter(writer, settings).processRecords(beans);
}
Also used : FixedWidthWriterSettings(com.univocity.parsers.fixed.FixedWidthWriterSettings) BeanWriterProcessor(com.univocity.parsers.common.processor.BeanWriterProcessor) FixedWidthWriter(com.univocity.parsers.fixed.FixedWidthWriter)

Aggregations

BeanWriterProcessor (com.univocity.parsers.common.processor.BeanWriterProcessor)1 FixedWidthWriter (com.univocity.parsers.fixed.FixedWidthWriter)1 FixedWidthWriterSettings (com.univocity.parsers.fixed.FixedWidthWriterSettings)1