use of com.univocity.parsers.common.processor.BeanWriterProcessor 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);
}
use of com.univocity.parsers.common.processor.BeanWriterProcessor in project powsybl-core by powsybl.
the class AbstractRecordGroup method settingsForCsvWriter.
CsvWriterSettings settingsForCsvWriter(String[] headers, String[] quotedFields, Context context) {
BeanWriterProcessor<T> processor = new BeanWriterProcessor<>(psseTypeClass());
CsvWriterSettings settings = new CsvWriterSettings();
settings.quoteFields(quotedFields);
settings.setHeaders(headers);
settings.getFormat().setQuote(context.getFileFormat().getQuote());
settings.getFormat().setDelimiter(context.getDelimiter());
settings.setIgnoreLeadingWhitespaces(false);
settings.setIgnoreTrailingWhitespaces(false);
settings.setRowWriterProcessor(processor);
return settings;
}
Aggregations