Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.cfg

public final Class BaseSettings

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.text.DateFormat, java.util.Locale, .TimeZone, com.fasterxml.jackson.core.Base64Variant, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy, .AnnotationIntrospectorPair, .ClassIntrospector, .DefaultAccessorNamingStrategy, com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator, .TypeResolverBuilder, com.fasterxml.jackson.databind.type.TypeFactory, com.fasterxml.jackson.databind.util.StdDateFormat

Immutable container class used to store simple configuration settings for both serialization and deserialization. Since instances are fully immutable, instances can be freely shared and used without synchronization.

Field Summary

Modifier and TypeField and Description
protected final AccessorNamingStrategy.Provider
_accessorNaming

Provider for creating AccessorNamingStrategy instances to use

protected final AnnotationIntrospector
_annotationIntrospector

Introspector used for accessing annotation value based configuration.

protected final CacheProvider
_cacheProvider

Used to provide custom cache implementation in downstream components.

protected final ClassIntrospector
_classIntrospector

Introspector used to figure out Bean properties needed for bean serialization and deserialization.

protected final DateFormat
_dateFormat

Custom date format to use for deserialization.

protected final Base64Variant
_defaultBase64

Explicitly default Base64Variant to use for handling binary data (byte[]), used with data formats that use base64 encoding (like JSON, CSV).

protected final HandlerInstantiator
_handlerInstantiator

Object used for creating instances of handlers (serializers, deserializers, type and type id resolvers), given class to instantiate.

protected final Locale
_locale

Default java.util.Locale used with serialization formats.

protected final PropertyNamingStrategy
_propertyNamingStrategy

Custom property naming strategy in use, if any.

protected final TimeZone
_timeZone

Default java.util.TimeZone used with serialization formats, if (and only if!) explicitly set by use; otherwise `null` to indicate "use default", which means "UTC" (from Jackson 2.7); earlier versions (up to 2.6) used "GMT".

protected final TypeFactory
_typeFactory

Specific factory used for creating JavaType instances; needed to allow modules to add more custom type handling (mostly to support types of non-Java JVM languages)

protected final TypeResolverBuilder<?>
_typeResolverBuilder

Builder used to create type resolver for serializing and deserializing values for which polymorphic type handling is needed.

protected final PolymorphicTypeValidator
_typeValidator

Validator that is used to limit allowed polymorphic subtypes, mostly for security reasons when dealing with untrusted content.

private static final TimeZone
DEFAULT_TIMEZONE

We will use a default TimeZone as the baseline.

private static final long

Constructor Summary

AccessConstructor and Description
public
public
BaseSettings(ClassIntrospector ci, AnnotationIntrospector ai, PropertyNamingStrategy pns, TypeFactory tf, TypeResolverBuilder<?> typer, DateFormat dateFormat, HandlerInstantiator hi, Locale locale, TimeZone tz, Base64Variant defaultBase64, PolymorphicTypeValidator ptv, AccessorNamingStrategy.Provider accNaming)
Deprecated Since 2.16, use variant that takes CacheProvider instead.

public

Method Summary

Modifier and TypeMethod and Description
private DateFormat
public BaseSettings
copy()

Turns out we are not necessarily 100% stateless, alas, since ClassIntrospector typically has a cache.

public AccessorNamingStrategy.Provider
public AnnotationIntrospector
public Base64Variant
public CacheProvider
public ClassIntrospector
public DateFormat
public HandlerInstantiator
public Locale
public PolymorphicTypeValidator
public PropertyNamingStrategy
public TimeZone
public TypeFactory
public TypeResolverBuilder<?>
public boolean
hasExplicitTimeZone()

Accessor that may be called to determine whether this settings object has been explicitly configured with a TimeZone (true), or is still relying on the default settings (false).

public BaseSettings
public BaseSettings
with(TimeZone tz)

Fluent factory for constructing a new instance that uses specified TimeZone.

public BaseSettings
public BaseSettings
public BaseSettings

Returns:

a new instance with provided CacheProvider.
with
(CacheProvider cacheProvider)

Fluent factory for constructing a new instance with provided CacheProvider.

public BaseSettings
public BaseSettings
public BaseSettings
public BaseSettings
public BaseSettings
public BaseSettings
public BaseSettings
public BaseSettings
public BaseSettings
public BaseSettings
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_accessorNamingback to summary
protected final AccessorNamingStrategy.Provider _accessorNaming

Provider for creating AccessorNamingStrategy instances to use

Since
2.12
_annotationIntrospectorback to summary
protected final AnnotationIntrospector _annotationIntrospector

Introspector used for accessing annotation value based configuration.

_cacheProviderback to summary
protected final CacheProvider _cacheProvider

Used to provide custom cache implementation in downstream components.

Since
2.16
_classIntrospectorback to summary
protected final ClassIntrospector _classIntrospector

Introspector used to figure out Bean properties needed for bean serialization and deserialization. Overridable so that it is possible to change low-level details of introspection, like adding new annotation types.

_dateFormatback to summary
protected final DateFormat _dateFormat

Custom date format to use for deserialization. If specified, will be used instead of com.fasterxml.jackson.databind.util.StdDateFormat.

Note that the configured format object will be cloned once per deserialization process (first time it is needed)

_defaultBase64back to summary
protected final Base64Variant _defaultBase64

Explicitly default Base64Variant to use for handling binary data (byte[]), used with data formats that use base64 encoding (like JSON, CSV).

Since
2.1
_handlerInstantiatorback to summary
protected final HandlerInstantiator _handlerInstantiator

Object used for creating instances of handlers (serializers, deserializers, type and type id resolvers), given class to instantiate. This is typically used to do additional configuration (with dependency injection, for example) beyond simply construction of instances; or to use alternative constructors.

_localeback to summary
protected final Locale _locale

Default java.util.Locale used with serialization formats. Default value is Locale#getDefault().

_propertyNamingStrategyback to summary
protected final PropertyNamingStrategy _propertyNamingStrategy

Custom property naming strategy in use, if any.

_timeZoneback to summary
protected final TimeZone _timeZone

Default java.util.TimeZone used with serialization formats, if (and only if!) explicitly set by use; otherwise `null` to indicate "use default", which means "UTC" (from Jackson 2.7); earlier versions (up to 2.6) used "GMT".

Note that if a new value is set, timezone is also assigned to _dateFormat of this object.

_typeFactoryback to summary
protected final TypeFactory _typeFactory

Specific factory used for creating JavaType instances; needed to allow modules to add more custom type handling (mostly to support types of non-Java JVM languages)

_typeResolverBuilderback to summary
protected final TypeResolverBuilder<?> _typeResolverBuilder

Builder used to create type resolver for serializing and deserializing values for which polymorphic type handling is needed.

_typeValidatorback to summary
protected final PolymorphicTypeValidator _typeValidator

Validator that is used to limit allowed polymorphic subtypes, mostly for security reasons when dealing with untrusted content.

Since
2.10
DEFAULT_TIMEZONEback to summary
private static final TimeZone DEFAULT_TIMEZONE

We will use a default TimeZone as the baseline.

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

BaseSettingsback to summary
public BaseSettings(ClassIntrospector ci, AnnotationIntrospector ai, PropertyNamingStrategy pns, TypeFactory tf, TypeResolverBuilder<?> typer, DateFormat dateFormat, HandlerInstantiator hi, Locale locale, TimeZone tz, Base64Variant defaultBase64, PolymorphicTypeValidator ptv, AccessorNamingStrategy.Provider accNaming, CacheProvider cacheProvider)
Since
2.16
BaseSettingsback to summary
public BaseSettings(ClassIntrospector ci, AnnotationIntrospector ai, PropertyNamingStrategy pns, TypeFactory tf, TypeResolverBuilder<?> typer, DateFormat dateFormat, HandlerInstantiator hi, Locale locale, TimeZone tz, Base64Variant defaultBase64, PolymorphicTypeValidator ptv, AccessorNamingStrategy.Provider accNaming)

Deprecated

Since 2.16, use variant that takes CacheProvider instead.

Annotations
@Deprecated
Since
2.12
BaseSettingsback to summary
public BaseSettings(ClassIntrospector ci, AnnotationIntrospector ai, PropertyNamingStrategy pns, TypeFactory tf, TypeResolverBuilder<?> typer, DateFormat dateFormat, HandlerInstantiator hi, Locale locale, TimeZone tz, Base64Variant defaultBase64, PolymorphicTypeValidator ptv)

Deprecated

Annotations
@Deprecated

Method Detail

_forceback to summary
private DateFormat _force(DateFormat df, TimeZone tz)
copyback to summary
public BaseSettings copy()

Turns out we are not necessarily 100% stateless, alas, since ClassIntrospector typically has a cache. So this method is needed for deep copy() of Mapper.

Since
2.9.6
getAccessorNamingback to summary
public AccessorNamingStrategy.Provider getAccessorNaming()
getAnnotationIntrospectorback to summary
public AnnotationIntrospector getAnnotationIntrospector()
getBase64Variantback to summary
public Base64Variant getBase64Variant()
getCacheProviderback to summary
public CacheProvider getCacheProvider()
Since
2.16
getClassIntrospectorback to summary
public ClassIntrospector getClassIntrospector()
getDateFormatback to summary
public DateFormat getDateFormat()
getHandlerInstantiatorback to summary
public HandlerInstantiator getHandlerInstantiator()
getLocaleback to summary
public Locale getLocale()
getPolymorphicTypeValidatorback to summary
public PolymorphicTypeValidator getPolymorphicTypeValidator()
Since
2.10
getPropertyNamingStrategyback to summary
public PropertyNamingStrategy getPropertyNamingStrategy()
getTimeZoneback to summary
public TimeZone getTimeZone()
getTypeFactoryback to summary
public TypeFactory getTypeFactory()
getTypeResolverBuilderback to summary
public TypeResolverBuilder<?> getTypeResolverBuilder()
hasExplicitTimeZoneback to summary
public boolean hasExplicitTimeZone()

Accessor that may be called to determine whether this settings object has been explicitly configured with a TimeZone (true), or is still relying on the default settings (false).

Since
2.7
withback to summary
public BaseSettings with(Locale l)
withback to summary
public BaseSettings with(TimeZone tz)

Fluent factory for constructing a new instance that uses specified TimeZone. Note that timezone used with also be assigned to configured DateFormat, changing time formatting defaults.

withback to summary
public BaseSettings with(Base64Variant base64)
Since
2.1
withback to summary
public BaseSettings with(PolymorphicTypeValidator v)
Since
2.10
withback to summary
public BaseSettings with(CacheProvider cacheProvider)

Fluent factory for constructing a new instance with provided CacheProvider.

Returns:BaseSettings

a new instance with provided CacheProvider.

Since
2.16
withAccessorNamingback to summary
public BaseSettings withAccessorNaming(AccessorNamingStrategy.Provider p)
withAnnotationIntrospectorback to summary
public BaseSettings withAnnotationIntrospector(AnnotationIntrospector ai)
withAppendedAnnotationIntrospectorback to summary
public BaseSettings withAppendedAnnotationIntrospector(AnnotationIntrospector ai)
withClassIntrospectorback to summary
public BaseSettings withClassIntrospector(ClassIntrospector ci)
withDateFormatback to summary
public BaseSettings withDateFormat(DateFormat df)
withHandlerInstantiatorback to summary
public BaseSettings withHandlerInstantiator(HandlerInstantiator hi)
withInsertedAnnotationIntrospectorback to summary
public BaseSettings withInsertedAnnotationIntrospector(AnnotationIntrospector ai)
withPropertyNamingStrategyback to summary
public BaseSettings withPropertyNamingStrategy(PropertyNamingStrategy pns)
withTypeFactoryback to summary
public BaseSettings withTypeFactory(TypeFactory tf)
withTypeResolverBuilderback to summary
public BaseSettings withTypeResolverBuilder(TypeResolverBuilder<?> typer)