class DataElementPopulator {

    public DataElement populateDataElement(Map<String, Serializable> row, DataTypeInfo dataType)
    {
        DataElement dataElement = null;

        MetaDataInfo metaInfo = dataType.getMetaDataInfo();
        MetaDataProvider provider = myMetaDataPopulator.populateProvider(row, metaInfo);
        MapGeometrySupport geometrySupport = myMapGeometryCreator.createGeometrySupport(row);

        Color typeColor = dataType.getBasicVisualizationInfo().getTypeColor();
        String timeColumn = metaInfo.getKeyForSpecialType(TimeKey.DEFAULT);
        TimeSpan timeSpan = TimeSpan.TIMELESS;
        if (timeColumn != null)
        {
            Serializable value = row.get(timeColumn);
            if (value != null)
            {
                String stringValue = value.toString();
                if (stringValue.contains("T") && stringValue.contains("Z"))
                {
                    try
                    {
                        timeSpan = TimeSpan.get(DateTimeUtilities.parseISO8601Date(value.toString()));
                    }
                    catch (ParseException e)
                    {
                        LOGGER.error(e, e);
                    }
                }
            }
        }
        if (geometrySupport != null)
        {
            dataElement = new DefaultMapDataElement(ourIDCounter.incrementAndGet(), timeSpan, dataType, provider,
                    geometrySupport);
            geometrySupport.setColor(typeColor, this);
            geometrySupport.setTimeSpan(timeSpan);
        }
        else
        {
            dataElement = new DefaultDataElement(ourIDCounter.incrementAndGet(), timeSpan, dataType, provider);
        }

        dataElement.getVisualizationState().setColor(typeColor);

        return dataElement;
    }

}