public Object stringToValue(String text) throws ParseException
{
// TF:9/3/08:This class is only used to format numeric data objects, so we know from it's
// construction that the value class must be a subclass of data value
Class<? extends DataValue> formatClass = (Class<? extends DataValue>)getValueClass();
NumericData numericData = (NumericData) FormatterUtils.createDataValueInstance(formatClass);
if (!FormatterUtils.isNullable(numericData, text))
{
// Check if the value is null, then map to 0. This is what Forte did. CraigM: 19/02/2008.
if (text == null || text.length() == 0) {
setNumericData(numericData, 0);
}
else {
Number number = (Number) getFormat().parseObject(text);
setNumericData(numericData, number);
}
}
else
{
numericData.setIsNull(true);
}
return numericData;
}