Super CSV Changelog

What's new in Super CSV 2.4.0

Oct 31, 2015
  • Some long overdue features and bug fixes, plus some exciting new features from our new contributors.
  • New features:
  • New maxLinesPerRow preference
  • New CsvResultSetWriter for writing JDBC result sets
  • Cell Processors for Java 8 time related classes: Duration, LocalDate, LocalDateTime, etc.
  • Improve write performance in multi-threaded environment. Added new AbstractCsvWriter constructor which allows to define whether given writer should be wrapped by BufferedWriter class or not.
  • Bug fixes:
  • Fixed misleading Exception for a CSV file with mismatched quotes
  • CsvContext is no longer being reset when exceptions are ignored
  • General enhancements:
  • CsvPreference.getQuoteChar() now returns a char instead of an int
  • CellProcessor.execute(final Object value, final CsvContext context) now returns generic T instead of an Object
  • Minor changes:
  • super-csv passes "Turkey Test"
  • Fixed documentation for CsvDozerBeanWriter class
  • Created test suite due to Comparison matrix page

New in Super CSV 2.3.1 (Aug 11, 2015)

  • Fixed a regression introduced in the last release.
  • Bug fixes:
  • 30 - Fixed bug in Tokenizer where consecutive quoted newlines caused a StringIndexOutOfBoundsException

New in Super CSV 2.3.0 (Aug 11, 2015)

  • General housekeeping, plus a brand new Joda-Time extension packed with useful cell processors.
  • New features:
  • 15 - Cell Processors for Joda-Time
  • Bug fixes:
  • 18 - Fixed locale-dependent unit test
  • General enhancements:
  • 20 - Memory optimization in Tokenizer
  • 28 - Allowed validateInputNotNull() to be overridden by cell processors
  • Breaking changes:
  • 17 - Removed deprecated AbstractCsvWriter.escapeString() method

New in Super CSV 2.2.1 (Aug 11, 2015)

  • Moved the project to GitHub (and git!), as well as some features and bug fixes.
  • New features:
  • 40 - Added ignoreCase functionality to ParseBool
  • 48 - Added ignoreEmptyLines preference
  • Bug fixes:
  • 43 - Fixed DefaultCsvEncoder to prevent StringIndexOutOfBoundsException when using preferences in multiple threads.

New in Super CSV 2.2.0 (Apr 25, 2014)

  • New features:
  • 28 - CsvBeanReader and CsvDozerBeanReader can now read into existing beans
  • 39 - ParseBigDecimal now removes grouping separators if DecimalFormatSymbols are supplied
  • 41 - A new ParseEnum cell processor for parsing Enums
  • Bug fixes:
  • 45 - CsvBeanReader and CsvBeanWriter are more flexible when matching getters/setters (case is ignored)
  • 46 - DMinMax and LMinMax processors can now be chained after StringCellProcessors
  • 49 - HashMapper now allows all kinds of processors to be chained after it

New in Super CSV 2.1.0 (Apr 24, 2013)

  • New features:
  • Added locale support to ParseDate processor
  • Readers can now skip comments (via the skipComments CsvPreference) and Writers can write comments (via the writeComment() method)
  • Upgrade to Dozer 5.4.0
  • Added a quoteMode preference that allows quoting to be enabled when it's normally not required, as well as adding a csvEncoder preference that allows complete control over how CSV is encoded for writing.
  • Added Collector and IsElementOf cell processors, which can be combined to ensure referential integrity. Collector can also help during development - you could apply a Collector (with a Set) to a column to find out all of the unique values for that column!
  • Added support for boolean getters (e.g. isX()) to CsvBeanWriter
  • CsvListReader now supports cell processors for CSV files with a variable number of columns
  • Bug fixes:
  • AbstractCsvWriter.escapeString() now increments the line count correctly for embedded newlines
  • CsvDozerBeanReader now accepts hints when reading into Lists of beans using indexed mapping
  • General enhancements:
  • Resurrected the speed benchmark tests. There's now a full suite of benchmark tests for all the readers/writers.

New in Super CSV 2.0.1 (Dec 14, 2012)

  • Bug fixes:
  • CsvBeanReader allows a nameMapping array of the wrong size when processors aren't used
  • Restore Java 5 compatibility

New in Super CSV 2.0.0 (Dec 14, 2012)

  • Bug fixes:
  • Added missing WEDNESDAY enum literal to custom cell processor example
  • Added SLF4J API jar to distribution zip file
  • CsvListReader now returns a new List for each read() operation

New in Super CSV 2.0.0 Beta 1 (Dec 14, 2012)

  • New features:
  • 100% RFC 4180 compliance
  • Super CSV now supports mapping nested properties (deep mapping and index-based mapping) with the new CsvDozerBeanReader and CsvDozerBeanWriter (included in the super-csv-dozer-extension project).
  • CsvBeanReader now supports any compatible setter method (as long as the parameter type - interface or object - is compatible with the object being set). Previously, the parameter type had to be an exact match on the object's type.
  • All Writers implement Flushable
  • OSGi support
  • All Readers and Writers now implement Closeable
  • Maven support (see details on the download page)
  • All Readers now have a getUntokenizedRow() method for retrieving the raw String of the row just read (before it's been tokenized). All Readers and Writers now have a getRowNumber() method for getting the number of CSV rows read/written (including the header). This is different from getLineNumber(), which returns the physical line number, as rows may span more than one line (the CSV format allows for multiline fields, as long as they're within double-quotes).
  • Bug fixes:
  • Fixed NPE in CsvBeanReader when value to set is null
  • AbstractCsvWriter now escapes for trailing spaces
  • Refactored Readers/Writers so it's no longer possible to modify preferences
  • Fixed NPE in SuperCsvException constructor
  • New surroundingSpacesNeedQuotes preference allows the disabling of quoting for leading spaces
  • CsvListWriter now allows all cell processors (not just String processors)
  • Column numbers now start at 1 (instead of 0)
  • All writers now allow null in the nameMapping array (except CsvDozerBeanWriter)
  • General enhancements:
  • Complete overhaul of javadoc
  • Improved test coverage (now 100%!)
  • More defensive programming (à la Josh Bloch's Effective Java). It's a lot harder to do silly stuff with the API now - for example CellProcessors will fail fast during construction if not set up correctly, instead of during execution.
  • A new and improved maven site (please like/+1 us!)
  • Removed dependency on the Spiffy library - Super CSV (excluding the new Dozer extension) is now completely standalone!
  • Upgrade notes:
  • As this is a major release and it's been 4 years since the last release, there have been numerous changes that are not backwards-compatible with older versions. Here's an overview of things to be aware of when upgrading from version 1.52:
  • General changes:
  • The treatment of spaces surrounding a cell has changed
  • All spaces are now considered important (to conform to RFC 4180), and surrounding spaces won't be trimmed by default
  • A new preference has been added to enable/disable this functionality (see the section on surroundingSpacesNeedQuotes on the preferences page).
  • Line number, row number (a new property of both readers and writers) and column number all start from 1. This means:
  • the get(int n) method of all Readers now expects the column number to begin at 1 (it was previously 0)
  • the column number reported in Exceptions (via the CsvContext object) begins at 1
  • the new row number property refers to one record of CSV (which may span multiple physical lines) - this number begins at 1 and includes the header
  • line number refers to the physical line of CSV being read/written and begins at 1 (same as before).
  • CsvPreference is now immutable, and must be constructed using its internal builder (see the preferences page)
  • All classes with CSV in their name have been renamed to Csv. The new names are:
  • SuperCsvException
  • SuperCsvReflectionException
  • CsvContext
  • Exceptions have been tidied up
  • ClassCastInputCSVException and NullInputException have been removed (SuperCsvCellProcessorException is now used when an unexpected type or null input is encountered in a cell processor).
  • SuperCsvException has been updated. It no longer contains the offending processor, as there's a new exception (SuperCsvCellProcessorException) for this.
  • SuperCsvCellProcessorException has been added as a general exception for anything that goes wrong during cell processor execution.
  • SuperCsvConstraintViolationException has been added. This exception is only thrown when the processor can accept the input (it's of the expected type and not null), but it doesn't satisfy the constraint. For example, if LMinMax encounters a Long value, but it is outside the required range then a SuperCsvConstraintViolationException will be thrown. If the LMinMax processor encounters a decimal value (e.g. 1.5), then a general SuperCsvCellProcessorException will be thrown.
  • Changes related to reading
  • The getCSVHeader() on all Readers has been renamed to getHeader() (to match writeHeader() on Writers)
  • All Readers will now read empty columns (i.e. "") as null (previously they would be read as ""). The Optional processor has been updated to cater for this.
  • All Readers now implement Closeable
  • All Readers now have a getUntokenizedRow() method which returns the untokenized CSV row that was just read
  • All Readers now have a getRowNumber() method which returns the number of the CSV row just read (essentially the number of records, including the header)
  • CsvListReader now returns a List of Objects (not Strings) when CellProcessors are used
  • CsvMapReader read() methods no longer have wildcards in their return type
  • CsvBeanReader now allows any compatible setter method to be used (e.g. if the value to map to the bean is a Double, then a setter that expects a Number will now work - previously the setter would have to expect a Double as well).
  • Changes related to writing
  • All Writers will now write null columns as "" (previously this would have caused an Exception).
  • All Writers now implement Closeable
  • All Writers now implement Flushable - so you can flush the stream without closing.
  • All Writers now have a getRowNumber() method which returns the number of the CSV row just written (essentially the number of records, including the header)
  • Changes related to CellProcessors:
  • The Optional processor now matches on null instead of "". This means it can now be used for reading and writing.
  • The Required, StrForbidden, and StrRegExReplace processors have been removed. Instead, you should use RequireHashCode, ForbidSubStr, and StrReplace respectively.
  • The Trim processor now trims whitespace (i.e. String.trim()). The new Truncate processor contains the old Trim functionality.
  • The min/max constants in DMinMax and LMinMax have all been renamed, and extra constants added to distinguish between signed/unsigned 8-bit min/max values.
  • StrRegEx now uses Matcher.matches() instead of Matcher.find(), so the regular expression must match the whole field
  • All processors have been updated to use the new exception classes SuperCsvCellProcessorException and SuperCsvConstraintViolationException

New in Super CSV 1.52 (Dec 14, 2012)

  • Bug fixes:
  • Bug in CsvListWriter on null inputs

New in Super CSV 1.51 (Dec 14, 2012)

  • New features:
  • Improved processors. Extended auto boxing types to include boolean, float and double.