java.lang.Object
tools.jackson.databind.cfg.BaseSettings
- All Implemented Interfaces:
Serializable
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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AccessorNamingStrategy.ProviderProvider for creatingAccessorNamingStrategyinstances to useprotected final AnnotationIntrospectorIntrospector used for accessing annotation value based configuration.protected final CacheProviderUsed to provide custom cache implementation in downstream components.protected final ConstructorDetectorHandler that specifies some aspects of Constructor auto-detection.protected final DateFormatCustom date format to use for deserialization.protected final Base64VariantExplicitly defaultBase64Variantto use for handling binary data (byte[]), used with data formats that use base64 encoding (like JSON, CSV).protected final TypeResolverBuilder<?>Type information handler used for "default typing".protected final EnumNamingStrategyCustom enum naming strategy in use, if any.protected final HandlerInstantiatorObject used for creating instances of handlers (serializers, deserializers, type and type id resolvers), given class to instantiate.protected final LocaleDefaultLocaleused with serialization formats.protected final JsonNodeFactoryFactory used for constructingJsonNodeinstances.protected final PropertyNamingStrategyCustom property naming strategy in use, if any.protected final TimeZoneDefaultTimeZoneused with serialization formats, if (and only if!)protected final PolymorphicTypeValidatorValidator that is used to limit allowed subtypes during polymorphic deserialization, mostly for security reasons when dealing with untrusted content. -
Constructor Summary
ConstructorsConstructorDescriptionBaseSettings(AnnotationIntrospector ai, PropertyNamingStrategy pns, EnumNamingStrategy ens, AccessorNamingStrategy.Provider accNaming, TypeResolverBuilder<?> defaultTyper, PolymorphicTypeValidator ptv, DateFormat dateFormat, HandlerInstantiator hi, Locale locale, TimeZone tz, Base64Variant defaultBase64, CacheProvider cacheProvider, JsonNodeFactory nodeFactory, ConstructorDetector ctorDetector) -
Method Summary
Modifier and TypeMethodDescriptionbooleanAccessor 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).with(DateFormat df) Fluent factory for constructing a new instance that uses specified TimeZone.with(Base64Variant base64) with(CacheProvider cacheProvider) Fluent factory for constructing a new instance with providedCacheProvider.with(ConstructorDetector ctorDetector) with(EnumNamingStrategy ens) with(TypeResolverBuilder<?> typer) with(JsonNodeFactory nodeFactory)
-
Field Details
-
_annotationIntrospector
Introspector used for accessing annotation value based configuration. -
_propertyNamingStrategy
Custom property naming strategy in use, if any. -
_enumNamingStrategy
Custom enum naming strategy in use, if any. -
_accessorNaming
Provider for creatingAccessorNamingStrategyinstances to use -
_defaultTyper
Type information handler used for "default typing". -
_typeValidator
Validator that is used to limit allowed subtypes during polymorphic deserialization, mostly for security reasons when dealing with untrusted content. -
_dateFormat
Custom date format to use for deserialization. If specified, will be used instead ofStdDateFormat.Note that the configured format object will be cloned once per deserialization process (first time it is needed)
-
_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. -
_locale
DefaultLocaleused with serialization formats. Default value isLocale.getDefault(). -
_timeZone
DefaultTimeZoneused 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
_dateFormatof this object. -
_defaultBase64
Explicitly defaultBase64Variantto use for handling binary data (byte[]), used with data formats that use base64 encoding (like JSON, CSV). -
_cacheProvider
Used to provide custom cache implementation in downstream components. -
_nodeFactory
Factory used for constructingJsonNodeinstances. -
_ctorDetector
Handler that specifies some aspects of Constructor auto-detection.
-
-
Constructor Details
-
BaseSettings
public BaseSettings(AnnotationIntrospector ai, PropertyNamingStrategy pns, EnumNamingStrategy ens, AccessorNamingStrategy.Provider accNaming, TypeResolverBuilder<?> defaultTyper, PolymorphicTypeValidator ptv, DateFormat dateFormat, HandlerInstantiator hi, Locale locale, TimeZone tz, Base64Variant defaultBase64, CacheProvider cacheProvider, JsonNodeFactory nodeFactory, ConstructorDetector ctorDetector)
-
-
Method Details
-
withAnnotationIntrospector
-
withInsertedAnnotationIntrospector
-
withAppendedAnnotationIntrospector
-
with
-
with
-
with
-
with
-
with
-
with
-
with
-
with
-
with
Fluent factory for constructing a new instance that uses specified TimeZone. Note that timezone used with also be assigned to configuredDateFormat, changing time formatting defaults. -
with
-
with
Fluent factory for constructing a new instance with providedCacheProvider.- Returns:
- a new instance with provided
CacheProvider.
-
with
-
with
-
getAnnotationIntrospector
-
getPropertyNamingStrategy
-
getEnumNamingStrategy
-
getAccessorNaming
-
getDefaultTyper
-
getPolymorphicTypeValidator
-
getDateFormat
-
getHandlerInstantiator
-
getLocale
-
getTimeZone
-
hasExplicitTimeZone
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). -
getBase64Variant
-
getCacheProvider
-
getNodeFactory
-
getConstructorDetector
-