Technical documentation - norbert-radyk/spoiwo GitHub Wiki

Natures

In Spoiwo nature is a reference to the format/type into which the given spreadsheet model can be converted. The nature can be unidirectional (only one way conversion, either model -> format or format -> model) or bidirectional (conversion both ways).

At the moment SPOIWO supports the following natures unidirectionally:

  • XLSX (for model -> xlsx conversion)
  • CSV (for model -> csv conversion)

The initial reason for decoupling natures from model is to give users flexibility to choose which conversions they want to apply for the particular spreadsheet model.

Each nature should allow use to implement the conversion to the expected element object (i.e. String for csv, XSSFWorkbook for xlsx) in the form of convertAs{format} method as well as the ability to store the content in the expected file format saveAs{format} for both a single Sheet and a whole Workbook. In both cases the implicit class should be provided to allow users for dynamic import of the offered conversions. Please see here for the example of nature implementation

Please note: Although at the moment Spoiwo is strongly related to POI (as it's main functional offering) and therefore shipped with the POI conversion dependency in as single jar, we can foresee that in the future core model is going to be separated from its natures (and provided in the separate jars) which will allow for much more flexibility.