@@ -110,13 +110,14 @@ public final class DeserializationConfig
110
110
/**
111
111
* Constructor used by ObjectMapper to create default configuration object instance.
112
112
*
113
- * @since 2.12
113
+ * @since 2.14
114
114
*/
115
115
public DeserializationConfig (BaseSettings base ,
116
116
SubtypeResolver str , SimpleMixInResolver mixins , RootNameLookup rootNames ,
117
- ConfigOverrides configOverrides , CoercionConfigs coercionConfigs )
117
+ ConfigOverrides configOverrides , CoercionConfigs coercionConfigs ,
118
+ DatatypeFeatures datatypeFeatures )
118
119
{
119
- super (base , str , mixins , rootNames , configOverrides );
120
+ super (base , str , mixins , rootNames , configOverrides , datatypeFeatures );
120
121
_deserFeatures = DESER_FEATURE_DEFAULTS ;
121
122
_problemHandlers = null ;
122
123
_nodeFactory = JsonNodeFactory .instance ;
@@ -131,7 +132,7 @@ public DeserializationConfig(BaseSettings base,
131
132
/**
132
133
* Copy-constructor used for making a copy used by new {@link ObjectMapper}.
133
134
*
134
- * @since 2.12
135
+ * @since 2.14
135
136
*/
136
137
protected DeserializationConfig (DeserializationConfig src ,
137
138
SubtypeResolver str , SimpleMixInResolver mixins , RootNameLookup rootNames ,
@@ -150,22 +151,6 @@ protected DeserializationConfig(DeserializationConfig src,
150
151
_formatReadFeaturesToChange = src ._formatReadFeaturesToChange ;
151
152
}
152
153
153
- @ Deprecated // since 2.12, remove from 2.13 or later
154
- public DeserializationConfig (BaseSettings base ,
155
- SubtypeResolver str , SimpleMixInResolver mixins , RootNameLookup rootNames ,
156
- ConfigOverrides configOverrides ) {
157
- this (base , str , mixins , rootNames , configOverrides ,
158
- new CoercionConfigs ());
159
- }
160
-
161
- @ Deprecated // since 2.11.2, remove from 2.13 or later
162
- protected DeserializationConfig (DeserializationConfig src ,
163
- SimpleMixInResolver mixins , RootNameLookup rootNames ,
164
- ConfigOverrides configOverrides ) {
165
- this (src , src ._subtypeResolver , mixins , rootNames , configOverrides ,
166
- new CoercionConfigs ());
167
- }
168
-
169
154
/*
170
155
/**********************************************************
171
156
/* Life-cycle, secondary constructors to support
@@ -322,6 +307,24 @@ protected DeserializationConfig(DeserializationConfig src, SimpleMixInResolver m
322
307
_formatReadFeaturesToChange = src ._formatReadFeaturesToChange ;
323
308
}
324
309
310
+ /**
311
+ * @since 2.14
312
+ */
313
+ protected DeserializationConfig (DeserializationConfig src ,
314
+ DatatypeFeatures datatypeFeatures )
315
+ {
316
+ super (src , datatypeFeatures );
317
+ _deserFeatures = src ._deserFeatures ;
318
+ _problemHandlers = src ._problemHandlers ;
319
+ _nodeFactory = src ._nodeFactory ;
320
+ _coercionConfigs = src ._coercionConfigs ;
321
+ _ctorDetector = src ._ctorDetector ;
322
+ _parserFeatures = src ._parserFeatures ;
323
+ _parserFeaturesToChange = src ._parserFeaturesToChange ;
324
+ _formatReadFeatures = src ._formatReadFeatures ;
325
+ _formatReadFeaturesToChange = src ._formatReadFeaturesToChange ;
326
+ }
327
+
325
328
// for unit tests only:
326
329
protected BaseSettings getBaseSettings () { return _base ; }
327
330
@@ -343,6 +346,11 @@ protected final DeserializationConfig _withMapperFeatures(long mapperFeatures) {
343
346
_formatReadFeatures , _formatReadFeaturesToChange );
344
347
}
345
348
349
+ @ Override
350
+ protected final DeserializationConfig _with (DatatypeFeatures dtFeatures ) {
351
+ return new DeserializationConfig (this , dtFeatures );
352
+ }
353
+
346
354
/*
347
355
/**********************************************************
348
356
/* Life-cycle, specific factory methods from MapperConfig
@@ -811,8 +819,16 @@ public boolean useRootWrapping()
811
819
return isEnabled (DeserializationFeature .UNWRAP_ROOT_VALUE );
812
820
}
813
821
814
- public final boolean isEnabled (DeserializationFeature f ) {
815
- return (_deserFeatures & f .getMask ()) != 0 ;
822
+ /**
823
+ * Accessor for checking whether give {@link DeserializationFeature}
824
+ * is enabled or not.
825
+ *
826
+ * @param feature Feature to check
827
+ *
828
+ * @return True if feature is enabled; false otherwise
829
+ */
830
+ public final boolean isEnabled (DeserializationFeature feature ) {
831
+ return (_deserFeatures & feature .getMask ()) != 0 ;
816
832
}
817
833
818
834
public final boolean isEnabled (JsonParser .Feature f , JsonFactory factory ) {
@@ -852,7 +868,7 @@ public final int getDeserializationFeatures() {
852
868
}
853
869
854
870
/**
855
- * Convenience method equivalant to:
871
+ * Convenience method equivalent to:
856
872
*<code>
857
873
* isEnabled(DeserializationFeature.FAIL_ON_TRAILING_TOKENS)
858
874
*</code>
@@ -863,6 +879,20 @@ public final boolean requiresFullValue() {
863
879
return DeserializationFeature .FAIL_ON_TRAILING_TOKENS .enabledIn (_deserFeatures );
864
880
}
865
881
882
+ /**
883
+ * Accessor for checking whether give {@link DatatypeFeature}
884
+ * is enabled or not.
885
+ *
886
+ * @param feature Feature to check
887
+ *
888
+ * @return True if feature is enabled; false otherwise
889
+ *
890
+ * @since 2.14
891
+ */
892
+ public final boolean isEnabled (DatatypeFeature feature ) {
893
+ return _datatypeFeatures .isEnabled (feature );
894
+ }
895
+
866
896
/*
867
897
/**********************************************************
868
898
/* Other configuration
0 commit comments