final boolean isCurrencyCode = suffix.length() == 3 && Character.isLetter(suffix.charAt(0)) && Character.isLetter(suffix.charAt(1)) && Character.isLetter(suffix.charAt(2));
return isCurrencyCode;
}
private Money parseDerivedValue(final Object original, final String entry) {
Money money = (Money) original;
if (money == null || money.getCurrency().equals(LOCAL_CURRENCY_CODE)) {
try {
final double value = DEFAULT_CURRENCY_FORMAT.parse(entry).doubleValue();
money = new Money(value, LOCAL_CURRENCY_CODE);
return money;
} catch (final ParseException ignore) {
}
}
try {
final double value = DEFAULT_NUMBER_FORMAT.parse(entry).doubleValue();
final String currencyCode = money == null ? defaultCurrencyCode : money.getCurrency();
money = new Money(value, currencyCode);
return money;
} catch (final ParseException ex) {
throw new TextEntryParseException("Not a distinguishable money value " + entry, ex);
}
}