result.append(PropertyEntry.dotForm(section, subSection,
name));
result.append(", value is ");
result.append(value);
result.append(".");
throw new AnalystError(result.toString());
}
break;
case TypeDouble:
Double.parseDouble(value);
break;
case typeFormat:
if (ConvertStringConst.string2AnalystFileFormat(value)
== null) {
final StringBuilder result = new StringBuilder();
result.append("Invalid file format for ");
result.append(PropertyEntry.dotForm(section, subSection,
name));
result.append(", value is ");
result.append(value);
result.append(".");
throw new AnalystError(result.toString());
}
break;
case TypeInteger:
Integer.parseInt(value);
break;
case TypeListString:
break;
case TypeString:
break;
default:
throw new AnalystError("Unsupported property type.");
}
} catch (final NumberFormatException ex) {
final StringBuilder result = new StringBuilder();
result.append("Illegal value for ");
result.append(PropertyEntry.dotForm(section, subSection, name));
result.append(", expecting a ");
result.append(getEntryType().toString());
result.append(", but got ");
result.append(value);
result.append(".");
throw new AnalystError(result.toString());
}
}