class FeatureRowExporter {

    public void exportRow(DataElement element, FeatureDao dao, List<Pair<FeatureColumn, String>> columns)
    {
        FeatureRow row = dao.newRow();

        exportGeometry(element, dao, row);

        for (Pair<FeatureColumn, String> pair : columns)
        {
            String elementColumnName = pair.getSecondObject();
            String geopackageColumnName = pair.getFirstObject().getName();
            if (pair.getFirstObject().getDataType() == GeoPackageDataType.DATETIME)
            {
                Date theDate = null;
                if (!element.getTimeSpan().isUnboundedStart())
                {
                    theDate = element.getTimeSpan().getStartDate();
                }
                else if (!element.getTimeSpan().isUnboundedEnd())
                {
                    theDate = element.getTimeSpan().getEndDate();
                }

                if (theDate != null)
                {
                    row.setValue(geopackageColumnName, DateTimeUtilities.generateISO8601DateString(theDate));
                }
            }
            else
            {
                Object value = element.getMetaData().getValue(elementColumnName);
                if (value instanceof DoubleRange)
                {
                    value = Double.valueOf(((DoubleRange)value).doubleValue());
                }
                else if (value instanceof Date)
                {
                    value = DateTimeUtilities.generateISO8601DateString((Date)value);
                }

                row.setValue(geopackageColumnName, value);
            }
        }

        dao.insert(row);
    }

}