Package toxi.data.csv
Class CSVParser
java.lang.Object
toxi.data.csv.CSVParser
An event-based CSV data parser with support for field aliases. Parse events
are generated for single rows and total completion (or failures). This allows
the parsing to function asynchronously in its own thread.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Parses the given String array of CSV text lines and emits parse events for clients to process individual rows.void
setMapper
(CSVFieldMapper mapper)
-
Constructor Details
-
CSVParser
-
-
Method Details
-
getDispatcher
- Returns:
- the dispatcher
-
getMapper
- Returns:
- the mapper
-
parse
Parses the given String array of CSV text lines and emits parse events for clients to process individual rows. The first row (1st array index) is assumed to contain the fieldnames, just as it would be the case with a standard CSV file.- Parameters:
lines
- array of CSV formatted lines of text
-
setMapper
- Parameters:
mapper
- the mapper to set
-