New features

Configuration of header (column name) line numbers

When reading CSV files, fixed width files and Excel spreadsheets it is now possible to supply which line/row number to use for column headers.

Alternatively you can also specify to NOT interpret any lines as the header - in such a case columns will be named using an alphabetical approach like the headers of a spreadsheet: A, B, C... Z, AA, AB etc.


Configuration of line and column skipping in Excel

In the Excel module configuration of automatic skipping of empty lines and columns have been made available. Previously the default strategy would always applied: Skip empty lines, not empty columns.

Changes to the existing API

Removal of IDataContextStrategy interface and strategy pattern

From early on we've had a single DataContext implementation (the DefaultDataContext class) that took a strategy as a parameter. This led to design where it was very inconvenient to get access to datastore-specific features as well as to instantiate DataContexts without using the factory.

While you could argue that both these concerns are not main goals of MetaModel (actually quite the opposite), they are still sometimes nescesary for the expert users. For this reason we decided to remove the IDataContextStrategy interface and let all strategy implementations be actual DataContext implementations instead. The result is a more straight-forward class hierarchy which we think will make life easier for people new to MetaModel.


Apache POI upgraded to 3.7

Apache POI (used for Excel support in MetaModel) has been updated from version 3.6 to version 3.7.


Option to disable graceful handling of CSV line inconsistencies

MetaModel has always had a feature to gracefully handle differences in line lengths for CSV files. Sometimes you want to be notified of such inconsistencies if your application should instead crash.

To accomodate this requirement we've added a "failOnInconsistentRowLength" property in the CsvConfiguration class. We've also supplied the special exception type "InconsistentRowLengthException" which will be thrown if the property is set to true and an inconsistency occurs.


DataSet extends Iterable<Row>

The DataSet interface now extends Iterable<Row>. Among other niceties this allows for usage of DataSets in for-each loops, like this:

DataSet dataSet = ...;

for (Row row : dataSet) {
  ...
}

Bugfixes

Unnescesary opening of file streams in Excel support

In previous versions there was a minor bug pertaining to the file stream handing in the Excel module. For every read of an Excel spreadsheet there would be two open file input streams. Although not significant, this bug has been fixed.