FieldConfig fieldConfig = config.getFieldConfig(StringUtils
.toString(termRangeNode.getField()));
if (fieldConfig != null) {
NumericConfig numericConfig = fieldConfig
.get(ConfigurationKeys.NUMERIC_CONFIG);
if (numericConfig != null) {
FieldQueryNode lower = termRangeNode.getLowerBound();
FieldQueryNode upper = termRangeNode.getUpperBound();
String lowerText = lower.getTextAsString();
String upperText = upper.getTextAsString();
NumberFormat numberFormat = numericConfig.getNumberFormat();
Number lowerNumber = null, upperNumber = null;
if (lowerText.length() > 0) {
try {
lowerNumber = numberFormat.parse(lowerText);
} catch (ParseException e) {
throw new QueryNodeParseException(new MessageImpl(
QueryParserMessages.COULD_NOT_PARSE_NUMBER, lower
.getTextAsString(), numberFormat.getClass()
.getCanonicalName()), e);
}
}
if (upperText.length() > 0) {
try {
upperNumber = numberFormat.parse(upperText);
} catch (ParseException e) {
throw new QueryNodeParseException(new MessageImpl(
QueryParserMessages.COULD_NOT_PARSE_NUMBER, upper
.getTextAsString(), numberFormat.getClass()
.getCanonicalName()), e);
}
}
switch (numericConfig.getType()) {
case LONG:
if (upperNumber != null) upperNumber = upperNumber.longValue();
if (lowerNumber != null) lowerNumber = lowerNumber.longValue();
break;
case INT: