Search in sources :

Example 1 with FormatDateOnlyException

use of org.jaffa.datatypes.exceptions.FormatDateOnlyException in project jaffa-framework by jaffa-projects.

the class DateOnlyCriteriaField method parseAndAdd.

private static void parseAndAdd(String str, DateOnlyFieldMetaData meta, List values) throws FormatDateOnlyException {
    try {
        DateOnly parsedValue = null;
        if (str != null && str.length() > 0) {
            if (meta != null)
                parsedValue = Parser.parseDateOnly(str, meta.getLayout());
            else
                parsedValue = Parser.parseDateOnly(str);
        }
        values.add(parsedValue);
    } catch (FormatDateOnlyException e) {
        e.setField(meta != null ? meta.getLabelToken() : "");
        throw e;
    }
}
Also used : DateOnly(org.jaffa.datatypes.DateOnly) FormatDateOnlyException(org.jaffa.datatypes.exceptions.FormatDateOnlyException)

Aggregations

DateOnly (org.jaffa.datatypes.DateOnly)1 FormatDateOnlyException (org.jaffa.datatypes.exceptions.FormatDateOnlyException)1