@Override public BigDecimal getDecimalValue() throws IOException, JsonParseException { return delegate.getDecimalValue(); }
@Override public BigDecimal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonToken t = jp.getCurrentToken(); if (t == JsonToken.VALUE_NUMBER_INT || t == JsonToken.VALUE_NUMBER_FLOAT) { return jp.getDecimalValue(); } // String is ok too, can easily convert if (t == JsonToken.VALUE_STRING) { // let's do implicit re-parse String text = jp.getText().trim(); if (text.length() == 0) { return null; } try { return new BigDecimal(text); } catch (IllegalArgumentException iae) { throw ctxt.weirdStringException(_valueClass, "not a valid representation"); } } // Otherwise, no can do: throw ctxt.mappingException(_valueClass, t); } }
return jp.getDecimalValue().toBigInteger(); } else if (t != JsonToken.VALUE_STRING) { // let's do implicit re-parse
@Override public BigDecimal getDecimalValue() throws IOException, JsonParseException { return delegate.getDecimalValue(); }
@Override public BigDecimal getDecimalValue() throws IOException, JsonParseException { return parser.getDecimalValue(); }
if (nt == JsonParser.NumberType.BIG_DECIMAL || ctxt.isEnabled(DeserializationConfig.Feature.USE_BIG_DECIMAL_FOR_FLOATS)) { return nodeFactory.numberNode(jp.getDecimalValue());
switch (jp.getNumberType()) { case BIG_DECIMAL: writeNumber(jp.getDecimalValue()); break; case FLOAT:
@Override public BigDecimal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonToken t = jp.getCurrentToken(); if (t == JsonToken.VALUE_NUMBER_INT || t == JsonToken.VALUE_NUMBER_FLOAT) { return jp.getDecimalValue(); } // String is ok too, can easily convert if (t == JsonToken.VALUE_STRING) { // let's do implicit re-parse String text = jp.getText().trim(); if (text.length() == 0) { return null; } try { return new BigDecimal(text); } catch (IllegalArgumentException iae) { throw ctxt.weirdStringException(_valueClass, "not a valid representation"); } } // Otherwise, no can do: throw ctxt.mappingException(_valueClass, t); } }
return jp.getDecimalValue().toBigInteger(); } else if (t != JsonToken.VALUE_STRING) { // let's do implicit re-parse
switch (jp.getNumberType()) { case BIG_DECIMAL: writeNumber(jp.getDecimalValue()); break; case FLOAT:
return jp.getDecimalValue();
@Override public BigDecimal getDecimalValue() throws IOException, JsonParseException { return delegate.getDecimalValue(); }
return jp.getDecimalValue();
return jp.getDecimalValue();
if (nt == JsonParser.NumberType.BIG_DECIMAL || ctxt.isEnabled(DeserializationConfig.Feature.USE_BIG_DECIMAL_FOR_FLOATS)) { return nodeFactory.numberNode(jp.getDecimalValue());
switch (jp.getNumberType()) { case BIG_DECIMAL: writeNumber(jp.getDecimalValue()); break; case FLOAT:
switch (jp.getNumberType()) { case BIG_DECIMAL: writeNumber(jp.getDecimalValue()); break; case FLOAT: