public void setMixIns(java.util.Map<java.lang.Class<?>,java.lang.Class<?>> mixIns)
Add mix-in annotations to use for augmenting specified class or interface.
mixIns - a Map of entries with target classes (or interface) whose annotations
to effectively override as key and mix-in classes (or interface) whose
annotations are to be "added" to target's annotations as value.
public void setModules(java.util.List<Module> modules)
Set a complete list of modules to be registered with the ObjectMapper.
Note: If this is set, no finding of modules is going to happen - not by
Jackson, and not by Spring either (see setFindModulesViaServiceLoader(boolean)).
As a consequence, specifying an empty list here will suppress any kind of
public void setModulesToInstall(java.lang.Class<? extends Module>... modules)
Specify one or more modules by class (or class name in XML)
to be registered with the ObjectMapper.
Modules specified here will be registered after
Spring's autodetection of JSR-310 and Joda-Time, or Jackson's
finding of modules (see setFindModulesViaServiceLoader(boolean)),
allowing to eventually override their configuration.
public void setFindModulesViaServiceLoader(boolean findModules)
Set whether to let Jackson find available modules via the JDK ServiceLoader,
based on META-INF metadata in the classpath. Requires Jackson 2.2 or higher.
If this mode is not set, Spring's Jackson2ObjectMapperFactoryBean itself
will try to find the JSR-310 and Joda-Time support modules on the classpath -
provided that Java 8 and Joda-Time themselves are available, respectively.
Return the type of object that this FactoryBean creates,
or null if not known in advance.
This allows one to check for specific types of beans without
instantiating objects, for example on autowiring.
In the case of implementations that are creating a singleton object,
this method should try to avoid singleton creation as far as possible;
it should rather estimate the type in advance.
For prototypes, returning a meaningful type here is advisable too.
This method can be called before this FactoryBean has
been fully initialized. It must not rely on state created during
initialization; of course, it can still use such state if available.
NOTE: Autowiring will simply ignore FactoryBeans that return
null here. Therefore it is highly recommended to implement
this method properly, using the current state of the FactoryBean.
Is the object managed by this factory a singleton? That is,
will FactoryBean.getObject() always return the same object
(a reference that can be cached)?
NOTE: If a FactoryBean indicates to hold a singleton object,
the object returned from getObject() might get cached
by the owning BeanFactory. Hence, do not return true
unless the FactoryBean always exposes the same reference.
The singleton status of the FactoryBean itself will generally
be provided by the owning BeanFactory; usually, it has to be
defined as singleton there.
NOTE: This method returning false does not
necessarily indicate that returned objects are independent instances.
An implementation of the extended SmartFactoryBean interface
may explicitly indicate independent instances through its
SmartFactoryBean.isPrototype() method. Plain FactoryBean
implementations which do not implement this extended interface are
simply assumed to always return independent instances if the
isSingleton() implementation returns false.
The default implementation returns true, since a
FactoryBean typically manages a singleton instance.