* to the underlying type found in the JSON stream in these situations we need to convert
* the JsonNumber to something valid: Double or Long.
*/
public class JsonNumberObjectFactory implements ObjectFactory {
public Object instantiate(ObjectBinder context, Object value, Type targetType, Class targetClass) {
JsonNumber number = (JsonNumber) value;
if( number.isLong() ) {
return number.longValue();
} else {
return number.doubleValue();
}
}