public static class JacksonModule.Config
extends java.lang.Object
JacksonModule
.Constructor and Description |
---|
Config() |
Modifier and Type | Method and Description |
---|---|
java.util.List<Module> |
getModules()
The
Jackson modules to register with the object mapper. |
boolean |
isPrettyPrint()
Whether JSON should be pretty printed.
|
JacksonModule.Config |
modules(java.lang.Iterable<Module> modules)
Add the given modules to the modules to be registered with the created object mapper.
|
JacksonModule.Config |
modules(Module... modules)
Add the given modules to the modules to be registered with the created object mapper.
|
JacksonModule.Config |
prettyPrint(boolean prettyPrint)
Sets whether JSON should be pretty printed.
|
JacksonModule.Config |
withMapper(java.util.function.Consumer<? super ObjectMapper> configurer)
Adds configuration actions to be executed against the object mapper created by this Guice module before it is used.
|
public boolean isPrettyPrint()
true
by default.
public JacksonModule.Config prettyPrint(boolean prettyPrint)
This value affects the ObjectWriter
instance provided by this Guice module.
If this binding is overridden, calling this method may have no effect.
prettyPrint
- whether JSON should be pretty printedpublic java.util.List<Module> getModules()
Jackson modules
to register with the object mapper.
Jackson modules extend Jackson to handle extra data types.
modules(Iterable)
,
modules(Module...)
public JacksonModule.Config modules(java.lang.Iterable<Module> modules)
This affects the ObjectMapper
instance provided by this Guice module.
If this binding is overridden, calling this method may have no effect.
modules
- the Jackson modulesmodules(Module...)
public JacksonModule.Config modules(Module... modules)
This affects the ObjectMapper
instance provided by this Guice module.
If this binding is overridden, calling this method may have no effect.
modules
- the Jackson modulesmodules(Iterable)
public JacksonModule.Config withMapper(java.util.function.Consumer<? super ObjectMapper> configurer)
This method is cumulative, with configure actions being executed in order. They are executed after applying other relevant configuration to the mapper (e.g. registering modules).
This affects the ObjectMapper
instance provided by this Guice module.
If this binding is overridden, calling this method may have no effect.
configurer
- configuration for the object mapper