36
36
import com .fasterxml .jackson .databind .PropertyNamingStrategy ;
37
37
import com .fasterxml .jackson .databind .SerializationFeature ;
38
38
import com .fasterxml .jackson .databind .cfg .HandlerInstantiator ;
39
+ import com .fasterxml .jackson .databind .jsontype .TypeResolverBuilder ;
39
40
import com .fasterxml .jackson .databind .ser .FilterProvider ;
40
41
import com .fasterxml .jackson .dataformat .xml .XmlMapper ;
41
42
@@ -215,6 +216,14 @@ public void setPropertyNamingStrategy(PropertyNamingStrategy propertyNamingStrat
215
216
this .builder .propertyNamingStrategy (propertyNamingStrategy );
216
217
}
217
218
219
+ /**
220
+ * Specify a {@link TypeResolverBuilder} to use for Jackson's default typing.
221
+ * @since 4.2.2
222
+ */
223
+ public void setDefaultTyping (TypeResolverBuilder <?> typeResolverBuilder ) {
224
+ this .builder .defaultTyping (typeResolverBuilder );
225
+ }
226
+
218
227
/**
219
228
* Set a custom inclusion strategy for serialization.
220
229
* @see com.fasterxml.jackson.annotation.JsonInclude.Include
@@ -223,6 +232,27 @@ public void setSerializationInclusion(JsonInclude.Include serializationInclusion
223
232
this .builder .serializationInclusion (serializationInclusion );
224
233
}
225
234
235
+ /**
236
+ * Set the global filters to use in order to support {@link JsonFilter @JsonFilter} annotated POJO.
237
+ * @since 4.2
238
+ * @see Jackson2ObjectMapperBuilder#filters(FilterProvider)
239
+ */
240
+ public void setFilters (FilterProvider filters ) {
241
+ this .builder .filters (filters );
242
+ }
243
+
244
+ /**
245
+ * Add mix-in annotations to use for augmenting specified class or interface.
246
+ * @param mixIns Map of entries with target classes (or interface) whose annotations
247
+ * to effectively override as key and mix-in classes (or interface) whose
248
+ * annotations are to be "added" to target's annotations as value.
249
+ * @since 4.1.2
250
+ * @see com.fasterxml.jackson.databind.ObjectMapper#addMixInAnnotations(Class, Class)
251
+ */
252
+ public void setMixIns (Map <Class <?>, Class <?>> mixIns ) {
253
+ this .builder .mixIns (mixIns );
254
+ }
255
+
226
256
/**
227
257
* Configure custom serializers. Each serializer is registered for the type
228
258
* returned by {@link JsonSerializer#handledType()}, which must not be
@@ -248,18 +278,6 @@ public void setDeserializersByType(Map<Class<?>, JsonDeserializer<?>> deserializ
248
278
this .builder .deserializersByType (deserializers );
249
279
}
250
280
251
- /**
252
- * Add mix-in annotations to use for augmenting specified class or interface.
253
- * @param mixIns Map of entries with target classes (or interface) whose annotations
254
- * to effectively override as key and mix-in classes (or interface) whose
255
- * annotations are to be "added" to target's annotations as value.
256
- * @since 4.1.2
257
- * @see com.fasterxml.jackson.databind.ObjectMapper#addMixInAnnotations(Class, Class)
258
- */
259
- public void setMixIns (Map <Class <?>, Class <?>> mixIns ) {
260
- this .builder .mixIns (mixIns );
261
- }
262
-
263
281
/**
264
282
* Shortcut for {@link MapperFeature#AUTO_DETECT_FIELDS} option.
265
283
*/
@@ -373,6 +391,11 @@ public void setFindModulesViaServiceLoader(boolean findModules) {
373
391
this .builder .findModulesViaServiceLoader (findModules );
374
392
}
375
393
394
+ @ Override
395
+ public void setBeanClassLoader (ClassLoader beanClassLoader ) {
396
+ this .builder .moduleClassLoader (beanClassLoader );
397
+ }
398
+
376
399
/**
377
400
* Customize the construction of Jackson handlers ({@link JsonSerializer}, {@link JsonDeserializer},
378
401
* {@link KeyDeserializer}, {@code TypeResolverBuilder} and {@code TypeIdResolver}).
@@ -384,17 +407,15 @@ public void setHandlerInstantiator(HandlerInstantiator handlerInstantiator) {
384
407
}
385
408
386
409
/**
387
- * Set the global filters to use in order to support {@link JsonFilter @JsonFilter} annotated POJO.
388
- * @since 4.2
389
- * @see Jackson2ObjectMapperBuilder#filters(FilterProvider)
410
+ * Set the builder {@link ApplicationContext} in order to autowire Jackson handlers ({@link JsonSerializer},
411
+ * {@link JsonDeserializer}, {@link KeyDeserializer}, {@code TypeResolverBuilder} and {@code TypeIdResolver}).
412
+ * @since 4.1.3
413
+ * @see Jackson2ObjectMapperBuilder#applicationContext(ApplicationContext)
414
+ * @see SpringHandlerInstantiator
390
415
*/
391
- public void setFilters (FilterProvider filters ) {
392
- this .builder .filters (filters );
393
- }
394
-
395
416
@ Override
396
- public void setBeanClassLoader ( ClassLoader beanClassLoader ) {
397
- this .builder .moduleClassLoader ( beanClassLoader );
417
+ public void setApplicationContext ( ApplicationContext applicationContext ) {
418
+ this .builder .applicationContext ( applicationContext );
398
419
}
399
420
400
421
@@ -408,18 +429,6 @@ public void afterPropertiesSet() {
408
429
}
409
430
}
410
431
411
- /**
412
- * Set the builder {@link ApplicationContext} in order to autowire Jackson handlers ({@link JsonSerializer},
413
- * {@link JsonDeserializer}, {@link KeyDeserializer}, {@code TypeResolverBuilder} and {@code TypeIdResolver}).
414
- * @since 4.1.3
415
- * @see Jackson2ObjectMapperBuilder#applicationContext(ApplicationContext)
416
- * @see SpringHandlerInstantiator
417
- */
418
- @ Override
419
- public void setApplicationContext (ApplicationContext applicationContext ) {
420
- this .builder .applicationContext (applicationContext );
421
- }
422
-
423
432
/**
424
433
* Return the singleton ObjectMapper.
425
434
*/
0 commit comments