Search in sources :

Example 1 with FormatCurrencyException

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

the class CurrencyCriteriaField method parseAndAdd.

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

Aggregations

Currency (org.jaffa.datatypes.Currency)1 FormatCurrencyException (org.jaffa.datatypes.exceptions.FormatCurrencyException)1