Skip navigation links

Package org.nuiton.csv

This package contains a framework to import and export data from a csv file using a model which permits us to validate what to do.

See: Description

Package org.nuiton.csv Description

This package contains a framework to import and export data from a csv file using a model which permits us to validate what to do.

Exporter API (since 3.0)

Steps to export

Example from a legacy model (with default configuration values)

     ExportModel<O> model = ...;
     Exporter<O> exporter = Exporter.of(model);
     Iterable<O> data = ...;
     String csv = exporter.writeToString(data);
 

Example from scratch

     ExportModel<O> model = ...;
     Exporter<O> exporter = Exporter
                                  .<O>builder()
                                  .addColum("propertyName")
                                  .addColum("headerName", "propertyName")
                                  .setCellSeparator(",")
                                  .build();
     Iterable<O> data = ...;
     String csv = exporter.writeToString(data);
 
Since:
2.4
Author:
Tony Chemit - chemit@codelutin.com
Skip navigation links

Copyright © 2013–2022 Code Lutin. All rights reserved.