ObjectMapper
, which
passes an immutable instance for serialization process to
SerializerProvider
and SerializerFactory
(either directly, or through ObjectWriter
.
Note that instances are considered immutable and as such no copies should need to be created for sharing; all copying is done with "fluent factory" methods.
Modifier and Type | Field and Description |
---|---|
protected final ConstructorDetector | |
protected final PrettyPrinter | _defaultPrettyPrinter
If "default pretty-printing" is enabled, it will create the instance from this blueprint object. |
protected final FilterProvider | _filterProvider
Object used for resolving filter ids to filter instances. |
protected final int | _formatWriteFeatures
States of |
protected final int | _formatWriteFeaturesToChange
Bitflag of |
protected final int | _generatorFeatures
States of |
protected final int | _generatorFeaturesToChange
Bitflag of |
protected final int | _serFeatures
Set of |
protected static final PrettyPrinter | |
private static final int | |
private static final long |
Access | Constructor and Description |
---|---|
public | SerializationConfig(BaseSettings base, SubtypeResolver str, SimpleMixInResolver mixins, RootNameLookup rootNames, ConfigOverrides configOverrides, DatatypeFeatures datatypeFeatures)
Constructor used by ObjectMapper to create default configuration object instance. |
public | SerializationConfig(BaseSettings base, SubtypeResolver str, SimpleMixInResolver mixins, RootNameLookup rootNames, ConfigOverrides configOverrides)
Deprecated
since 2.14
|
protected | SerializationConfig(SerializationConfig src, SubtypeResolver str, SimpleMixInResolver mixins, RootNameLookup rootNames, ConfigOverrides configOverrides)
Copy-constructor used for making a copy to be used by new |
private | |
private | SerializationConfig(SerializationConfig src, long mapperFeatures, int serFeatures, int generatorFeatures, int generatorFeatureMask, int formatFeatures, int formatFeaturesMask)
|
private | |
private | |
private | |
private | |
protected | |
protected | |
protected | |
protected | |
protected |
Modifier and Type | Method and Description |
---|---|
protected final SerializationConfig | _with(DatatypeFeatures dtFeatures)
Implements abstract com.
|
protected final SerializationConfig | _withBase(BaseSettings newBase)
Implements abstract com.
|
private SerializationConfig | |
protected final SerializationConfig | _withMapperFeatures(long mapperFeatures)
Implements abstract com.
|
private SerializationConfig | |
public PrettyPrinter | |
public ConstructorDetector | getConstructorDetector()
Implements abstract com.
|
public PrettyPrinter | getDefaultPrettyPrinter()
Accessor for configured blueprint "default" |
public FilterProvider | getFilterProvider()
Method for getting provider used for locating filters given id (which is usually provided with filter annotations). |
public final int | |
public JsonInclude. | |
public final boolean | hasSerializationFeatures(int featureMask)
"Bulk" access method for checking that all features specified by mask are enabled. |
public void | initialize(JsonGenerator g)
Method called by |
public BeanDescription | introspect(JavaType type)
Method that will introspect full bean properties for the purpose of building a bean serializer |
public final boolean | Returns: True if feature is enabled; false otherwiseFeature to check feature)Accessor for checking whether give |
public final boolean | isEnabled(JsonGenerator.
Accessor method that first checks if we have any overrides for feature, and only if not, checks state of passed-in factory. |
public final boolean | Returns: True if feature is enabled; false otherwiseFeature to check feature)Implements abstract com. Accessor for checking whether give |
public boolean | useRootWrapping()
Implements abstract com. Accessor for checking whether configuration indicates that "root wrapping" (use of an extra property/name pair at root level) is expected or not. |
public SerializationConfig | with(SubtypeResolver str)
Implements abstract com. Method for constructing and returning a new instance with different
|
public SerializationConfig | with(ContextAttributes attrs)
Implements abstract com. Method for constructing an instance that has specified contextual attributes. |
public SerializationConfig | with(DateFormat df)
Overrides com. In addition to constructing instance with specified date format,
will enable or disable |
public SerializationConfig | with(SerializationFeature feature)
Fluent factory method that will construct and return a new configuration object instance with specified feature enabled. |
public SerializationConfig | with(SerializationFeature first, SerializationFeature... features)
Fluent factory method that will construct and return a new configuration object instance with specified features enabled. |
public SerializationConfig | with(JsonGenerator.
Fluent factory method that will construct and return a new configuration object instance with specified feature enabled. |
public SerializationConfig | with(FormatFeature feature)
Fluent factory method that will construct and return a new configuration object instance with specified feature enabled. |
public SerializationConfig | |
public SerializationConfig | |
public SerializationConfig | withFeatures(SerializationFeature... features)
Fluent factory method that will construct and return a new configuration object instance with specified features enabled. |
public SerializationConfig | withFeatures(JsonGenerator.
Fluent factory method that will construct and return a new configuration object instance with specified features enabled. |
public SerializationConfig | withFeatures(FormatFeature... features)
Fluent factory method that will construct and return a new configuration object instance with specified features enabled. |
public SerializationConfig | |
public SerializationConfig | without(SerializationFeature feature)
Fluent factory method that will construct and return a new configuration object instance with specified feature disabled. |
public SerializationConfig | without(SerializationFeature first, SerializationFeature... features)
Fluent factory method that will construct and return a new configuration object instance with specified features disabled. |
public SerializationConfig | without(JsonGenerator.
Fluent factory method that will construct and return a new configuration object instance with specified feature disabled. |
public SerializationConfig | without(FormatFeature feature)
Fluent factory method that will construct and return a new configuration object instance with specified feature disabled. |
public SerializationConfig | withoutFeatures(SerializationFeature... features)
Fluent factory method that will construct and return a new configuration object instance with specified features disabled. |
public SerializationConfig | withoutFeatures(JsonGenerator.
Fluent factory method that will construct and return a new configuration object instance with specified features disabled. |
public SerializationConfig | withoutFeatures(FormatFeature... features)
Fluent factory method that will construct and return a new configuration object instance with specified features disabled. |
public SerializationConfig | withPropertyInclusion(JsonInclude.
Deprecated
Since 2.9; not needed any more
Mutant factory method for constructing a new instance with different default inclusion criteria configuration. |
public SerializationConfig | withRootName(PropertyName
to use: if null, means "use default" (clear setting);
if empty String ("") means that no root name wrapping is used;
otherwise defines root name to use. rootName)Implements abstract com. Method for constructing and returning a new instance with different root name to use (none, if null). |
public SerializationConfig | withView(Class<?> view)
Implements abstract com. Method for constructing and returning a new instance with different view to use. |
_ctorDetector | back to summary |
---|---|
protected final ConstructorDetector _ctorDetector
|
_defaultPrettyPrinter | back to summary |
---|---|
protected final PrettyPrinter _defaultPrettyPrinter If "default pretty-printing" is enabled, it will create the instance from this blueprint object.
|
_filterProvider | back to summary |
---|---|
protected final FilterProvider _filterProvider Object used for resolving filter ids to filter instances. Non-null if explicitly defined; null by default. |
_formatWriteFeatures | back to summary |
---|---|
protected final int _formatWriteFeatures States of
|
_formatWriteFeaturesToChange | back to summary |
---|---|
protected final int _formatWriteFeaturesToChange Bitflag of
|
_generatorFeatures | back to summary |
---|---|
protected final int _generatorFeatures States of |
_generatorFeaturesToChange | back to summary |
---|---|
protected final int _generatorFeaturesToChange Bitflag of |
_serFeatures | back to summary |
---|---|
protected final int _serFeatures Set of |
DEFAULT_PRETTY_PRINTER | back to summary |
---|---|
protected static final PrettyPrinter DEFAULT_PRETTY_PRINTER |
SER_FEATURE_DEFAULTS | back to summary |
---|---|
private static final int SER_FEATURE_DEFAULTS |
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID Hides com. |
SerializationConfig | back to summary |
---|---|
public SerializationConfig(BaseSettings base, SubtypeResolver str, SimpleMixInResolver mixins, RootNameLookup rootNames, ConfigOverrides configOverrides, DatatypeFeatures datatypeFeatures) Constructor used by ObjectMapper to create default configuration object instance.
|
SerializationConfig | back to summary |
---|---|
public SerializationConfig(BaseSettings base, SubtypeResolver str, SimpleMixInResolver mixins, RootNameLookup rootNames, ConfigOverrides configOverrides)
Deprecated since 2.14
|
SerializationConfig | back to summary |
---|---|
protected SerializationConfig(SerializationConfig src, SubtypeResolver str, SimpleMixInResolver mixins, RootNameLookup rootNames, ConfigOverrides configOverrides) Copy-constructor used for making a copy to be used by new
|
SerializationConfig | back to summary |
---|---|
private SerializationConfig(SerializationConfig src, SubtypeResolver str) |
SerializationConfig | back to summary |
---|---|
private SerializationConfig(SerializationConfig src, long mapperFeatures, int serFeatures, int generatorFeatures, int generatorFeatureMask, int formatFeatures, int formatFeaturesMask) |
SerializationConfig | back to summary |
---|---|
private SerializationConfig(SerializationConfig src, BaseSettings base) |
SerializationConfig | back to summary |
---|---|
private SerializationConfig(SerializationConfig src, FilterProvider filters) |
SerializationConfig | back to summary |
---|---|
private SerializationConfig(SerializationConfig src, Class<?> view) |
SerializationConfig | back to summary |
---|---|
private SerializationConfig(SerializationConfig src, PropertyName rootName) |
SerializationConfig | back to summary |
---|---|
protected SerializationConfig(SerializationConfig src, ContextAttributes attrs)
|
SerializationConfig | back to summary |
---|---|
protected SerializationConfig(SerializationConfig src, SimpleMixInResolver mixins)
|
SerializationConfig | back to summary |
---|---|
protected SerializationConfig(SerializationConfig src, PrettyPrinter defaultPP)
|
SerializationConfig | back to summary |
---|---|
protected SerializationConfig(SerializationConfig src, DatatypeFeatures dtFeatures)
|
SerializationConfig | back to summary |
---|---|
protected SerializationConfig(SerializationConfig src, ConstructorDetector ctorDetector)
|
_with | back to summary |
---|---|
protected final SerializationConfig _with(DatatypeFeatures dtFeatures) Implements abstract com.
|
_withBase | back to summary |
---|---|
protected final SerializationConfig _withBase(BaseSettings newBase) Implements abstract com.
|
_withJsonWriteFeatures | back to summary |
---|---|
private SerializationConfig _withJsonWriteFeatures(FormatFeature... features) |
_withMapperFeatures | back to summary |
---|---|
protected final SerializationConfig _withMapperFeatures(long mapperFeatures) Implements abstract com.
|
_withoutJsonWriteFeatures | back to summary |
---|---|
private SerializationConfig _withoutJsonWriteFeatures(FormatFeature... features) |
constructDefaultPrettyPrinter | back to summary |
---|---|
public PrettyPrinter constructDefaultPrettyPrinter() |
getConstructorDetector | back to summary |
---|---|
public ConstructorDetector getConstructorDetector() Implements abstract com.
|
getDefaultPrettyPrinter | back to summary |
---|---|
public PrettyPrinter getDefaultPrettyPrinter() Accessor for configured blueprint "default" Note returns the "blueprint" instance, and does NOT construct
an instance ready to use; call
|
getFilterProvider | back to summary |
---|---|
public FilterProvider getFilterProvider() Method for getting provider used for locating filters given
id (which is usually provided with filter annotations).
Will be null if no provided was set for |
getSerializationFeatures | back to summary |
---|---|
public final int getSerializationFeatures() |
getSerializationInclusion | back to summary |
---|---|
public JsonInclude. Deprecated Since 2.7 use
|
hasSerializationFeatures | back to summary |
---|---|
public final boolean hasSerializationFeatures(int featureMask) "Bulk" access method for checking that all features specified by mask are enabled.
|
initialize | back to summary |
---|---|
public void initialize(JsonGenerator g) Method called by
|
introspect | back to summary |
---|---|
public BeanDescription introspect(JavaType type) Method that will introspect full bean properties for the purpose of building a bean serializer |
isEnabled | back to summary |
---|---|
public final boolean isEnabled(SerializationFeature feature) Accessor for checking whether give
|
isEnabled | back to summary |
---|---|
public final boolean isEnabled(JsonGenerator. Accessor method that first checks if we have any overrides for feature, and only if not, checks state of passed-in factory.
|
isEnabled | back to summary |
---|---|
public final boolean isEnabled(DatatypeFeature feature) Implements abstract com. Accessor for checking whether give
|
useRootWrapping | back to summary |
---|---|
public boolean useRootWrapping() Implements abstract com. Doc from com. Accessor for checking whether configuration indicates that "root wrapping" (use of an extra property/name pair at root level) is expected or not.
|
with | back to summary |
---|---|
public SerializationConfig with(SubtypeResolver str) Implements abstract com. Doc from com. Method for constructing and returning a new instance with different
Note make sure to register new instance with
|
with | back to summary |
---|---|
public SerializationConfig with(ContextAttributes attrs) Implements abstract com. Doc from com. Method for constructing an instance that has specified contextual attributes.
|
with | back to summary |
---|---|
public SerializationConfig with(DateFormat df) Overrides com. In addition to constructing instance with specified date format,
will enable or disable
|
with | back to summary |
---|---|
public SerializationConfig with(SerializationFeature feature) Fluent factory method that will construct and return a new configuration object instance with specified feature enabled. |
with | back to summary |
---|---|
public SerializationConfig with(SerializationFeature first, SerializationFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features enabled. |
with | back to summary |
---|---|
public SerializationConfig with(JsonGenerator. Fluent factory method that will construct and return a new configuration object instance with specified feature enabled.
|
with | back to summary |
---|---|
public SerializationConfig with(FormatFeature feature) Fluent factory method that will construct and return a new configuration object instance with specified feature enabled.
|
with | back to summary |
---|---|
public SerializationConfig with(ConstructorDetector ctorDetector)
|
withDefaultPrettyPrinter | back to summary |
---|---|
public SerializationConfig withDefaultPrettyPrinter(PrettyPrinter pp)
|
withFeatures | back to summary |
---|---|
public SerializationConfig withFeatures(SerializationFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features enabled. |
withFeatures | back to summary |
---|---|
public SerializationConfig withFeatures(JsonGenerator. Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
|
withFeatures | back to summary |
---|---|
public SerializationConfig withFeatures(FormatFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
|
withFilters | back to summary |
---|---|
public SerializationConfig withFilters(FilterProvider filterProvider) |
without | back to summary |
---|---|
public SerializationConfig without(SerializationFeature feature) Fluent factory method that will construct and return a new configuration object instance with specified feature disabled. |
without | back to summary |
---|---|
public SerializationConfig without(SerializationFeature first, SerializationFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features disabled. |
without | back to summary |
---|---|
public SerializationConfig without(JsonGenerator. Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.
|
without | back to summary |
---|---|
public SerializationConfig without(FormatFeature feature) Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.
|
withoutFeatures | back to summary |
---|---|
public SerializationConfig withoutFeatures(SerializationFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features disabled. |
withoutFeatures | back to summary |
---|---|
public SerializationConfig withoutFeatures(JsonGenerator. Fluent factory method that will construct and return a new configuration object instance with specified features disabled.
|
withoutFeatures | back to summary |
---|---|
public SerializationConfig withoutFeatures(FormatFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features disabled.
|
withPropertyInclusion | back to summary |
---|---|
public SerializationConfig withPropertyInclusion(JsonInclude. Deprecated Since 2.9; not needed any more Mutant factory method for constructing a new instance with different default inclusion criteria configuration.
|
withRootName | back to summary |
---|---|
public SerializationConfig withRootName(PropertyName rootName) Implements abstract com. Doc from com. Method for constructing and returning a new instance with different root name to use (none, if null).
Note that when a root name is set to a non-Empty String, this will automatically force use
of root element wrapping with given name. If empty String passed, will
disable root name wrapping; and if null used, will instead use
|
withView | back to summary |
---|---|
public SerializationConfig withView(Class<?> view) Implements abstract com. Doc from com. Method for constructing and returning a new instance with different view to use.
|