Search in sources :

Example 1 with DefaultDateFormatProperty

use of org.simpleflatmapper.map.property.DefaultDateFormatProperty in project SimpleFlatMapper by arnaudroger.

the class CsvColumnDefinition method dateFormats.

public String[] dateFormats() {
    DateFormatProperty[] prop = lookForAll(DateFormatProperty.class);
    String[] patterns = new String[prop.length];
    for (int i = 0; i < prop.length; i++) {
        patterns[i] = prop[i].get();
    }
    if (patterns.length == 0) {
        DefaultDateFormatProperty defaultDateFormatProperty = lookFor(DefaultDateFormatProperty.class);
        if (defaultDateFormatProperty == null) {
            throw new IllegalStateException("No date format specified");
        }
        return new String[] { defaultDateFormatProperty.get() };
    }
    return patterns;
}
Also used : DefaultDateFormatProperty(org.simpleflatmapper.map.property.DefaultDateFormatProperty) DefaultDateFormatProperty(org.simpleflatmapper.map.property.DefaultDateFormatProperty) DateFormatProperty(org.simpleflatmapper.map.property.DateFormatProperty)

Aggregations

DateFormatProperty (org.simpleflatmapper.map.property.DateFormatProperty)1 DefaultDateFormatProperty (org.simpleflatmapper.map.property.DefaultDateFormatProperty)1