if (value instanceof Float || value instanceof Double)
return ((Number) value).doubleValue();
else if (value instanceof String)
return Double.valueOf((String) value).doubleValue();
else
throw new MessageValueException("Type " + value.getClass().getName()
+ " can't be converted to Double.");
}