Class CsvParserSession

All Implemented Interfaces:
BeanSession, ConverterSession, RecordReadable

public class CsvParserSession extends ReaderParserSession implements RecordReadable
Session object that lives for the duration of a single use of CsvParser.

Parses CSV (Comma Separated Values) input into Java objects. The first row of the CSV is treated as a header row providing column names. Subsequent rows are treated as data rows.

The following target type mappings are supported:

  • Collection<Bean> / Bean[] — Header row provides property names; each data row becomes a bean.
  • Collection<Map> / Map[] — Header row provides map keys; each data row becomes a map.
  • Collection<SimpleType> / SimpleType[] — Single value column; each row's value is coerced to the element type.
  • Single Bean — Header row + one data row → one bean.
  • Single Map — Header row + one data row → one map.
  • Object — Returns a JsonList of JsonMap entries.
Notes:
  • This class is not thread safe and is typically discarded after one use.