|
5 | 5 | import java.math.BigInteger; |
6 | 6 |
|
7 | 7 | import com.fasterxml.jackson.databind.*; |
8 | | -import com.fasterxml.jackson.databind.cfg.CoercionAction; |
9 | | -import com.fasterxml.jackson.databind.cfg.CoercionInputShape; |
10 | 8 | import com.fasterxml.jackson.databind.deser.impl.PropertyValueBuffer; |
11 | 9 | import com.fasterxml.jackson.databind.introspect.AnnotatedWithParams; |
12 | | -import com.fasterxml.jackson.databind.type.LogicalType; |
13 | 10 |
|
14 | 11 | /** |
15 | 12 | * Class that defines simple API implemented by objects that create value |
@@ -422,50 +419,6 @@ public Object createFromBoolean(DeserializationContext ctxt, boolean value) thro |
422 | 419 | */ |
423 | 420 | public AnnotatedWithParams getWithArgsCreator() { return null; } |
424 | 421 |
|
425 | | - /* |
426 | | - /********************************************************** |
427 | | - /* Helper methods |
428 | | - /********************************************************** |
429 | | - */ |
430 | | - |
431 | | - /** |
432 | | - * @since 2.4 (demoted from <code>StdValueInstantiator</code>) |
433 | | - * @deprecated Since 2.12 should not handle coercions here |
434 | | - */ |
435 | | - @Deprecated // since 2.12 |
436 | | - @SuppressWarnings("resource") |
437 | | - protected Object _createFromStringFallbacks(DeserializationContext ctxt, String value) |
438 | | - throws IOException |
439 | | - { |
440 | | - // also, empty Strings might be accepted as null Object... |
441 | | - if (value.isEmpty()) { |
442 | | - if (ctxt.isEnabled(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) { |
443 | | - return null; |
444 | | - } |
445 | | - } |
446 | | - |
447 | | - /* 28-Sep-2011, tatu: Ok this is not clean at all; but since there are legacy |
448 | | - * systems that expect conversions in some cases, let's just add a minimal |
449 | | - * patch (note: same could conceivably be used for numbers too). |
450 | | - */ |
451 | | - if (canCreateFromBoolean()) { |
452 | | - // 29-May-2020, tatu: With 2.12 can and should use CoercionConfig so: |
453 | | - if (ctxt.findCoercionAction(LogicalType.Boolean, Boolean.class, |
454 | | - CoercionInputShape.String) == CoercionAction.TryConvert) { |
455 | | - String str = value.trim(); |
456 | | - if ("true".equals(str)) { |
457 | | - return createFromBoolean(ctxt, true); |
458 | | - } |
459 | | - if ("false".equals(str)) { |
460 | | - return createFromBoolean(ctxt, false); |
461 | | - } |
462 | | - } |
463 | | - } |
464 | | - return ctxt.handleMissingInstantiator(getValueClass(), this, ctxt.getParser(), |
465 | | - "no String-argument constructor/factory method to deserialize from String value ('%s')", |
466 | | - value); |
467 | | - } |
468 | | - |
469 | 422 | /* |
470 | 423 | /********************************************************** |
471 | 424 | /* Standard Base implementation (since 2.8) |
|
0 commit comments