public interface CsvTransformer
| Modifier and Type | Method and Description |
|---|---|
<T> List<T> |
fromCsv(File file,
Class<T> typeOfT)
This method reads the given CSV data from a file and loads it into a list.
|
<T> List<T> |
fromCsv(Reader csv,
Class<T> typeOfT)
This method reads the given CSV data and loads it into a list.
|
<T> List<T> |
fromCsv(String csv,
Class<T> typeOfT)
This method reads the given CSV data and loads it into a list.
|
<T> void |
toCsv(File file,
List<? extends T> rows,
Class<T> typeOfT)
Transforms the given object list into a CSV data and write it into the given file.
|
<T> String |
toCsv(List<? extends T> rows,
Class<T> typeOfT)
Transforms the given object list into a CSV data and returns it.
|
<T> void |
toCsv(OutputStream stream,
List<? extends T> rows,
Class<T> typeOfT)
Transforms the given object list into a CSV data and write it into the given stream.
|
<T> List<T> fromCsv(String csv, Class<T> typeOfT) throws TransformerException
T - type of the result objectscsv - the CSV contenttypeOfT - type of the result objectsTransformerException - if csv is not a valid CSV data<T> List<T> fromCsv(Reader csv, Class<T> typeOfT) throws TransformerException
T - type of the result objectscsv - the Reader containing CSV datatypeOfT - type of the objectsTransformerException - if csv is not a valid CSV data<T> List<T> fromCsv(File file, Class<T> typeOfT) throws TransformerException
T - type of the result objectsfile - the file which contains the CSV datatypeOfT - type of the objectsTransformerException - if csv is not a valid CSV file<T> String toCsv(List<? extends T> rows, Class<T> typeOfT) throws TransformerException
Object class., (comma) character.T - type of the objectsrows - the list of objectstypeOfT - the class which will be used to construct the headerTransformerException - if one of the fields cannot be transformed to CSV value<T> void toCsv(OutputStream stream, List<? extends T> rows, Class<T> typeOfT) throws TransformerException
Object class., (comma) character.
The charset of the data will be UTF-8.T - type of the objectsstream - the stream which will receive the CSV datarows - the list of objectstypeOfT - the class which will be used to construct the headerTransformerException - if one of the fields cannot be transformed to CSV value of there was an error writing into the stream<T> void toCsv(File file, List<? extends T> rows, Class<T> typeOfT) throws TransformerException
Object class., (comma) character.
The charset of the data will be UTF-8.T - type of the objectsfile - the CSV filerows - the list of objectstypeOfT - the class which will be used to construct the headerTransformerException - if one of the fields cannot be transformed to CSV value of there was an error writing into the fileCreated by Kornél Simon, 2022