1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2015 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
118
118
* Note that Jackson's JSR-310 and Joda-Time support modules will be registered automatically
119
119
* when available (and when Java 8 and Joda-Time themselves are available, respectively).
120
120
*
121
- * <p>Tested against Jackson 2.2, 2.3 and 2.4 ; compatible with Jackson 2.0 and higher.
121
+ * <p>Tested against Jackson 2.2, 2.3, 2.4 and 2.5 ; compatible with Jackson 2.0 and higher.
122
122
*
123
123
* @author <a href="mailto:[email protected] ">Dmitry Katsubo</a>
124
124
* @author Rossen Stoyanchev
@@ -346,6 +346,7 @@ public void setModules(List<Module> modules) {
346
346
* @since 4.0.1
347
347
* @see com.fasterxml.jackson.databind.Module
348
348
*/
349
+ @ SuppressWarnings ("unchecked" )
349
350
public void setModulesToInstall (Class <? extends Module >... modules ) {
350
351
this .builder .modulesToInstall (modules );
351
352
}
@@ -363,6 +364,11 @@ public void setFindModulesViaServiceLoader(boolean findModules) {
363
364
this .builder .findModulesViaServiceLoader (findModules );
364
365
}
365
366
367
+ @ Override
368
+ public void setBeanClassLoader (ClassLoader beanClassLoader ) {
369
+ this .builder .moduleClassLoader (beanClassLoader );
370
+ }
371
+
366
372
/**
367
373
* Customize the construction of Jackson handlers ({@link JsonSerializer}, {@link JsonDeserializer},
368
374
* {@link KeyDeserializer}, {@code TypeResolverBuilder} and {@code TypeIdResolver}).
@@ -373,14 +379,20 @@ public void setHandlerInstantiator(HandlerInstantiator handlerInstantiator) {
373
379
this .builder .handlerInstantiator (handlerInstantiator );
374
380
}
375
381
382
+ /**
383
+ * Set the builder {@link ApplicationContext} in order to autowire Jackson handlers ({@link JsonSerializer},
384
+ * {@link JsonDeserializer}, {@link KeyDeserializer}, {@code TypeResolverBuilder} and {@code TypeIdResolver}).
385
+ * @since 4.1.3
386
+ * @see Jackson2ObjectMapperBuilder#applicationContext(ApplicationContext)
387
+ * @see SpringHandlerInstantiator
388
+ */
376
389
@ Override
377
- public void setBeanClassLoader ( ClassLoader beanClassLoader ) {
378
- this .builder .moduleClassLoader ( beanClassLoader );
390
+ public void setApplicationContext ( ApplicationContext applicationContext ) {
391
+ this .builder .applicationContext ( applicationContext );
379
392
}
380
393
381
394
382
395
@ Override
383
- @ SuppressWarnings ("unchecked" )
384
396
public void afterPropertiesSet () {
385
397
if (this .objectMapper != null ) {
386
398
this .builder .configure (this .objectMapper );
@@ -390,18 +402,6 @@ public void afterPropertiesSet() {
390
402
}
391
403
}
392
404
393
- /**
394
- * Set the builder {@link ApplicationContext} in order to autowire Jackson handlers ({@link JsonSerializer},
395
- * {@link JsonDeserializer}, {@link KeyDeserializer}, {@code TypeResolverBuilder} and {@code TypeIdResolver}).
396
- * @since 4.1.3
397
- * @see Jackson2ObjectMapperBuilder#applicationContext(ApplicationContext)
398
- * @see SpringHandlerInstantiator
399
- */
400
- @ Override
401
- public void setApplicationContext (ApplicationContext applicationContext ) {
402
- this .builder .applicationContext (applicationContext );
403
- }
404
-
405
405
/**
406
406
* Return the singleton ObjectMapper.
407
407
*/
0 commit comments