@@ -55,6 +55,11 @@ public final class DeserializationConfig
55
55
*/
56
56
protected final CoercionConfigs _coercionConfigs ;
57
57
58
+ /**
59
+ * @since 2.12
60
+ */
61
+ protected final ConstructorDetector _ctorDetector ;
62
+
58
63
/*
59
64
/**********************************************************
60
65
/* Deserialization features
@@ -109,13 +114,13 @@ public final class DeserializationConfig
109
114
*/
110
115
public DeserializationConfig (BaseSettings base ,
111
116
SubtypeResolver str , SimpleMixInResolver mixins , RootNameLookup rootNames ,
112
- ConfigOverrides configOverrides ,
113
- CoercionConfigs coercionConfigs )
117
+ ConfigOverrides configOverrides , CoercionConfigs coercionConfigs )
114
118
{
115
119
super (base , str , mixins , rootNames , configOverrides );
116
120
_deserFeatures = DESER_FEATURE_DEFAULTS ;
117
121
_problemHandlers = null ;
118
122
_nodeFactory = JsonNodeFactory .instance ;
123
+ _ctorDetector = null ;
119
124
_coercionConfigs = coercionConfigs ;
120
125
_parserFeatures = 0 ;
121
126
_parserFeaturesToChange = 0 ;
@@ -137,6 +142,7 @@ protected DeserializationConfig(DeserializationConfig src,
137
142
_deserFeatures = src ._deserFeatures ;
138
143
_problemHandlers = src ._problemHandlers ;
139
144
_nodeFactory = src ._nodeFactory ;
145
+ _ctorDetector = src ._ctorDetector ;
140
146
_coercionConfigs = coercionConfigs ;
141
147
_parserFeatures = src ._parserFeatures ;
142
148
_parserFeaturesToChange = src ._parserFeaturesToChange ;
@@ -177,6 +183,7 @@ private DeserializationConfig(DeserializationConfig src,
177
183
_problemHandlers = src ._problemHandlers ;
178
184
_nodeFactory = src ._nodeFactory ;
179
185
_coercionConfigs = src ._coercionConfigs ;
186
+ _ctorDetector = src ._ctorDetector ;
180
187
_parserFeatures = parserFeatures ;
181
188
_parserFeaturesToChange = parserFeatureMask ;
182
189
_formatReadFeatures = formatFeatures ;
@@ -194,6 +201,7 @@ private DeserializationConfig(DeserializationConfig src, SubtypeResolver str)
194
201
_problemHandlers = src ._problemHandlers ;
195
202
_nodeFactory = src ._nodeFactory ;
196
203
_coercionConfigs = src ._coercionConfigs ;
204
+ _ctorDetector = src ._ctorDetector ;
197
205
_parserFeatures = src ._parserFeatures ;
198
206
_parserFeaturesToChange = src ._parserFeaturesToChange ;
199
207
_formatReadFeatures = src ._formatReadFeatures ;
@@ -207,19 +215,36 @@ private DeserializationConfig(DeserializationConfig src, BaseSettings base)
207
215
_problemHandlers = src ._problemHandlers ;
208
216
_nodeFactory = src ._nodeFactory ;
209
217
_coercionConfigs = src ._coercionConfigs ;
218
+ _ctorDetector = src ._ctorDetector ;
210
219
_parserFeatures = src ._parserFeatures ;
211
220
_parserFeaturesToChange = src ._parserFeaturesToChange ;
212
221
_formatReadFeatures = src ._formatReadFeatures ;
213
222
_formatReadFeaturesToChange = src ._formatReadFeaturesToChange ;
214
223
}
215
-
224
+
216
225
private DeserializationConfig (DeserializationConfig src , JsonNodeFactory f )
217
226
{
218
227
super (src );
219
228
_deserFeatures = src ._deserFeatures ;
220
229
_problemHandlers = src ._problemHandlers ;
221
230
_nodeFactory = f ;
222
231
_coercionConfigs = src ._coercionConfigs ;
232
+ _ctorDetector = src ._ctorDetector ;
233
+ _parserFeatures = src ._parserFeatures ;
234
+ _parserFeaturesToChange = src ._parserFeaturesToChange ;
235
+ _formatReadFeatures = src ._formatReadFeatures ;
236
+ _formatReadFeaturesToChange = src ._formatReadFeaturesToChange ;
237
+ }
238
+
239
+ // @since 2.12
240
+ private DeserializationConfig (DeserializationConfig src , ConstructorDetector ctorDetector )
241
+ {
242
+ super (src );
243
+ _deserFeatures = src ._deserFeatures ;
244
+ _problemHandlers = src ._problemHandlers ;
245
+ _nodeFactory = src ._nodeFactory ;
246
+ _coercionConfigs = src ._coercionConfigs ;
247
+ _ctorDetector = ctorDetector ;
223
248
_parserFeatures = src ._parserFeatures ;
224
249
_parserFeaturesToChange = src ._parserFeaturesToChange ;
225
250
_formatReadFeatures = src ._formatReadFeatures ;
@@ -234,6 +259,7 @@ private DeserializationConfig(DeserializationConfig src,
234
259
_problemHandlers = problemHandlers ;
235
260
_nodeFactory = src ._nodeFactory ;
236
261
_coercionConfigs = src ._coercionConfigs ;
262
+ _ctorDetector = src ._ctorDetector ;
237
263
_parserFeatures = src ._parserFeatures ;
238
264
_parserFeaturesToChange = src ._parserFeaturesToChange ;
239
265
_formatReadFeatures = src ._formatReadFeatures ;
@@ -247,6 +273,7 @@ private DeserializationConfig(DeserializationConfig src, PropertyName rootName)
247
273
_problemHandlers = src ._problemHandlers ;
248
274
_nodeFactory = src ._nodeFactory ;
249
275
_coercionConfigs = src ._coercionConfigs ;
276
+ _ctorDetector = src ._ctorDetector ;
250
277
_parserFeatures = src ._parserFeatures ;
251
278
_parserFeaturesToChange = src ._parserFeaturesToChange ;
252
279
_formatReadFeatures = src ._formatReadFeatures ;
@@ -260,6 +287,7 @@ private DeserializationConfig(DeserializationConfig src, Class<?> view)
260
287
_problemHandlers = src ._problemHandlers ;
261
288
_nodeFactory = src ._nodeFactory ;
262
289
_coercionConfigs = src ._coercionConfigs ;
290
+ _ctorDetector = src ._ctorDetector ;
263
291
_parserFeatures = src ._parserFeatures ;
264
292
_parserFeaturesToChange = src ._parserFeaturesToChange ;
265
293
_formatReadFeatures = src ._formatReadFeatures ;
@@ -273,6 +301,7 @@ protected DeserializationConfig(DeserializationConfig src, ContextAttributes att
273
301
_problemHandlers = src ._problemHandlers ;
274
302
_nodeFactory = src ._nodeFactory ;
275
303
_coercionConfigs = src ._coercionConfigs ;
304
+ _ctorDetector = src ._ctorDetector ;
276
305
_parserFeatures = src ._parserFeatures ;
277
306
_parserFeaturesToChange = src ._parserFeaturesToChange ;
278
307
_formatReadFeatures = src ._formatReadFeatures ;
@@ -286,6 +315,7 @@ protected DeserializationConfig(DeserializationConfig src, SimpleMixInResolver m
286
315
_problemHandlers = src ._problemHandlers ;
287
316
_nodeFactory = src ._nodeFactory ;
288
317
_coercionConfigs = src ._coercionConfigs ;
318
+ _ctorDetector = src ._ctorDetector ;
289
319
_parserFeatures = src ._parserFeatures ;
290
320
_parserFeaturesToChange = src ._parserFeaturesToChange ;
291
321
_formatReadFeatures = src ._formatReadFeatures ;
@@ -691,6 +721,16 @@ public DeserializationConfig with(JsonNodeFactory f) {
691
721
return new DeserializationConfig (this , f );
692
722
}
693
723
724
+ /**
725
+ * @since 2.12
726
+ */
727
+ public DeserializationConfig with (ConstructorDetector ctorDetector ) {
728
+ if (_ctorDetector == ctorDetector ) {
729
+ return this ;
730
+ }
731
+ return new DeserializationConfig (this , ctorDetector );
732
+ }
733
+
694
734
/**
695
735
* Method that can be used to add a handler that can (try to)
696
736
* resolve non-fatal deserialization problems.
@@ -841,6 +881,16 @@ public final JsonNodeFactory getNodeFactory() {
841
881
return _nodeFactory ;
842
882
}
843
883
884
+ /**
885
+ * @since 2.12
886
+ */
887
+ public ConstructorDetector getConstructorDetector () {
888
+ if (_ctorDetector == null ) {
889
+ return ConstructorDetector .DEFAULT ;
890
+ }
891
+ return _ctorDetector ;
892
+ }
893
+
844
894
/*
845
895
/**********************************************************
846
896
/* Introspection methods
0 commit comments