{
throw new NumberFormatException("The value '" + value + "' could not be parsed: " + e.getMessage());
}
// sanity check
if (result.compareTo(minValue) < 0)
throw new NumberFormatException("Value (" + result + ") was less than allowed minimum (" + minValue + ").");
if (result.compareTo(maxValue) > 0)
throw new NumberFormatException("Value (" + result + ") was more than allowed maximum (" + maxValue + ").");
return result;