Class ExportUtil
java.lang.Object
nl.datasteel.crudcraft.runtime.util.ExportUtil
Utility methods for exporting DTO lists to various formats.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <R> void
streamCsv
(Iterator<R> dtos, OutputStream out) Streams a list of DTOs to a CSV file.static <R> void
streamJson
(Iterator<R> dtos, OutputStream out) Streams a list of DTOs to a JSON array.static <R> void
streamXlsx
(Iterator<R> dtos, OutputStream out) Streams a list of DTOs to an XLSX file.static <R> byte[]
Exports a list of DTOs to a CSV file.static <R> byte[]
Exports a list of DTOs to a JSON array.static <R> byte[]
Exports a list of DTOs to an XLSX file.
-
Method Details
-
toCsv
Exports a list of DTOs to a CSV file.- Parameters:
dtos
- the list of DTOs to export- Returns:
- a byte array containing the CSV data
-
toJson
Exports a list of DTOs to a JSON array.- Parameters:
dtos
- the list of DTOs to export- Returns:
- a byte array containing the JSON data
-
toXlsx
Exports a list of DTOs to an XLSX file.- Parameters:
dtos
- the list of DTOs to export- Returns:
- a byte array containing the XLSX file data
-
streamCsv
Streams a list of DTOs to a CSV file.- Parameters:
dtos
- the iterator of DTOs to exportout
- the output stream to write the CSV to
-
streamJson
Streams a list of DTOs to a JSON array.- Parameters:
dtos
- the iterator of DTOs to exportout
- the output stream to write the JSON to
-
streamXlsx
Streams a list of DTOs to an XLSX file.- Parameters:
dtos
- the iterator of DTOs to exportout
- the output stream to write the XLSX file to
-