class AbstractTransformerWriter implements TransformerWriter {

    @Override
    public void write(DataSetRow row) throws IOException {
        if (!row.values().isEmpty() && row.getRowMetadata().getColumns().isEmpty()) {
            throw new IllegalStateException(
                    " If a dataset row has some values it should at least have columns just before writing the result of a non json transformation.");
        }
        // values need to be written in the same order as the columns
        getRecordsWriter().writeNext(row.order().toArray(DataSetRow.SKIP_TDP_ID));
    }

}