Class MapperConfigBase<CFG extends ConfigFeature,T extends MapperConfigBase<CFG,T>>
- java.lang.Object
-
- com.fasterxml.jackson.databind.cfg.MapperConfig<T>
-
- com.fasterxml.jackson.databind.cfg.MapperConfigBase<CFG,T>
-
- All Implemented Interfaces:
ClassIntrospector.MixInResolver,java.io.Serializable
- Direct Known Subclasses:
DeserializationConfig,SerializationConfig
public abstract class MapperConfigBase<CFG extends ConfigFeature,T extends MapperConfigBase<CFG,T>> extends MapperConfig<T> implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ClassIntrospector.MixInResolvercopy()Method called to create a new, non-shared copy, to be used by differentObjectMapperinstance, and one that should not be connected to this instance, if resolver has mutable state.ConfigOverridefindConfigOverride(java.lang.Class<?> type)Accessor for findingConfigOverrideto use for properties of given type, if any exist; or return `null` if not.java.lang.Class<?>findMixInClassFor(java.lang.Class<?> cls)Method that will check if there are "mix-in" classes (with mix-in annotations) for given classPropertyNamefindRootName(JavaType rootType)PropertyNamefindRootName(java.lang.Class<?> rawRootType)java.lang.Class<?>getActiveView()Accessor for finding currently active view, if any (null if none)ContextAttributesgetAttributes()Method for accessing per-instance shared (baseline/default) attribute values; these are used as the basis for per-call attributes.ConfigOverridegetConfigOverride(java.lang.Class<?> type)Accessor for findingConfigOverrideto use for properties of given type, if any exist; or if none, return an immutable "empty" instance with no overrides.DatatypeFeaturesgetDatatypeFeatures()JsonInclude.ValuegetDefaultInclusion(java.lang.Class<?> baseType, java.lang.Class<?> propertyType)Accessor for default property inclusion to use for serialization, considering possible per-type override for given base type and possible per-type override for given property type.
NOTE: if no override found, defaults to value returned byMapperConfig.getDefaultPropertyInclusion().java.lang.BooleangetDefaultMergeable()Accessor for the baseline merge info used as the global baseline, not considering possible per-type overrides.java.lang.BooleangetDefaultMergeable(java.lang.Class<?> baseType)Accessor for the baseline merge info used for given type, including global defaults if no type-specific overrides defined.JsonFormat.ValuegetDefaultPropertyFormat(java.lang.Class<?> type)Accessor for default format settings to use for serialization (and, to a degree deserialization), considering baseline settings and per-type defaults for given base type (if any).JsonIgnoreProperties.ValuegetDefaultPropertyIgnorals(java.lang.Class<?> type)Accessor for default property ignorals to use, if any, for given base type, based on config overrides settings (seeMapperConfig.findConfigOverride(Class)).JsonIgnoreProperties.ValuegetDefaultPropertyIgnorals(java.lang.Class<?> baseType, AnnotatedClass actualClass)Helper method that may be called to see if there are property ignoral definitions from annotations (viaAnnotatedClass) or through "config overrides".JsonInclude.ValuegetDefaultPropertyInclusion()Accessor for default property inclusion to use for serialization, used unless overridden by per-type or per-property overrides.JsonInclude.ValuegetDefaultPropertyInclusion(java.lang.Class<?> baseType)Accessor for default property inclusion to use for serialization, considering possible per-type override for given base type.
NOTE: if no override found, defaults to value returned byMapperConfig.getDefaultPropertyInclusion().JsonIncludeProperties.ValuegetDefaultPropertyInclusions(java.lang.Class<?> baseType, AnnotatedClass actualClass)Helper method that may be called to see if there are property inclusion definitions from annotations (viaAnnotatedClass).JsonSetter.ValuegetDefaultSetterInfo()Accessor for the baseline setter info used as the global baseline, not considering possible per-type overrides.VisibilityChecker<?>getDefaultVisibilityChecker()Accessor for object used for determining whether specific property elements (method, constructors, fields) can be auto-detected based on their visibility (access modifiers).VisibilityChecker<?>getDefaultVisibilityChecker(java.lang.Class<?> baseType, AnnotatedClass actualClass)Accessor for object used for determining whether specific property elements (method, constructors, fields) can be auto-detected based on their visibility (access modifiers).PropertyNamegetFullRootName()java.lang.StringgetRootName()Deprecated.Since 2.6 usegetFullRootName()instead.SubtypeResolvergetSubtypeResolver()Accessor for object used for finding out all reachable subtypes for supertypes; needed when a logical type name is used instead of class name (or custom scheme).intmixInCount()Test-only method -- does not reflect possibly open-ended set that external mix-in resolver might provide.Twith(Base64Variant base64)Method for constructing and returning a new instance with different defaultBase64Variantto use with base64-encoded binary values.Twith(AnnotationIntrospector ai)Method for constructing and returning a new instance with differentAnnotationIntrospectorto use (replacing old one).Twith(CacheProvider provider)abstract Twith(ContextAttributes attrs)Method for constructing an instance that has specified contextual attributes.Twith(DatatypeFeature feature)Fluent factory method that will return a configuration object instance with specified feature enabled: this may bethisinstance (if no changes effected), or a newly constructed instance.Twith(DatatypeFeature feature, boolean state)Fluent factory method that will construct and return a new configuration object instance with specified features disabled.Twith(HandlerInstantiator hi)Method for constructing and returning a new instance with differentHandlerInstantiatorto use.Twith(AccessorNamingStrategy.Provider p)Method for constructing and returning a new instance with differentPropertyNamingStrategyto use.Twith(ClassIntrospector ci)Method for constructing and returning a new instance with differentClassIntrospectorto use.abstract Twith(SubtypeResolver str)Method for constructing and returning a new instance with differentSubtypeResolverto use.Twith(TypeResolverBuilder<?> trb)Method for constructing and returning a new instance with differentTypeResolverBuilderto use.Twith(MapperFeature... features)Fluent factory method that will construct and return a new configuration object instance with specified features enabled.Twith(MapperFeature feature, boolean state)Twith(PropertyNamingStrategy pns)Method for constructing and returning a new instance with differentPropertyNamingStrategyto use.Twith(TypeFactory tf)Method for constructing and returning a new instance with differentTypeFactoryto use.Twith(java.text.DateFormat df)Method for constructing and returning a new instance with differentDateFormatto use.Twith(java.util.Locale l)Method for constructing and returning a new instance with different defaultLocaleto use for formatting.Twith(java.util.TimeZone tz)Method for constructing and returning a new instance with different defaultTimeZoneto use for formatting of date values.TwithAppendedAnnotationIntrospector(AnnotationIntrospector ai)Method for constructing and returning a new instance with additionalAnnotationIntrospectorappended (as the lowest priority one)TwithAttribute(java.lang.Object key, java.lang.Object value)Method for constructing an instance that has specified value for attribute for given key.TwithAttributes(java.util.Map<?,?> attributes)Method for constructing an instance that has only specified attributes, removing any attributes that exist before the call.TwithFeatures(DatatypeFeature... features)Fluent factory method that will return a configuration object instance with specified features enabled: this may bethisinstance (if no changes effected), or a newly constructed instance.TwithInsertedAnnotationIntrospector(AnnotationIntrospector ai)Method for constructing and returning a new instance with additionalAnnotationIntrospectorinserted (as the highest priority one)Twithout(DatatypeFeature feature)Fluent factory method that will return a configuration object instance with specified feature disabled: this may bethisinstance (if no changes effected), or a newly constructed instance.Twithout(MapperFeature... features)Fluent factory method that will construct and return a new configuration object instance with specified features disabled.TwithoutAttribute(java.lang.Object key)Method for constructing an instance that has no value for attribute for given key.TwithoutFeatures(DatatypeFeature... features)Fluent factory method that will return a configuration object instance with specified features disabled: this may bethisinstance (if no changes effected), or a newly constructed instance.abstract TwithRootName(PropertyName rootName)Method for constructing and returning a new instance with different root name to use (none, if null).TwithRootName(java.lang.String rootName)abstract TwithView(java.lang.Class<?> view)Method for constructing and returning a new instance with different view to use.-
Methods inherited from class com.fasterxml.jackson.databind.cfg.MapperConfig
canOverrideAccessModifiers, collectFeatureDefaults, compileString, constructSpecializedType, constructType, constructType, getAccessorNaming, getAnnotationIntrospector, getBase64Variant, getCacheProvider, getClassIntrospector, getDateFormat, getDefaultInclusion, getDefaultPropertyInclusion, getDefaultTyper, getHandlerInstantiator, getLocale, getPolymorphicTypeValidator, getPropertyNamingStrategy, getTimeZone, getTypeFactory, hasExplicitTimeZone, hasMapperFeatures, introspectClassAnnotations, introspectClassAnnotations, introspectDirectClassAnnotations, introspectDirectClassAnnotations, isAnnotationProcessingEnabled, isEnabled, isEnabled, shouldSortPropertiesAlphabetically, typeIdResolverInstance, typeResolverBuilderInstance, useRootWrapping
-
-
-
-
Method Detail
-
with
public final T with(MapperFeature... features)
Fluent factory method that will construct and return a new configuration object instance with specified features enabled.- Specified by:
within classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
without
public final T without(MapperFeature... features)
Fluent factory method that will construct and return a new configuration object instance with specified features disabled.- Specified by:
withoutin classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
with
public final T with(MapperFeature feature, boolean state)
- Specified by:
within classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
with
public final T with(DatatypeFeature feature)
Fluent factory method that will return a configuration object instance with specified feature enabled: this may bethisinstance (if no changes effected), or a newly constructed instance.
-
withFeatures
public final T withFeatures(DatatypeFeature... features)
Fluent factory method that will return a configuration object instance with specified features enabled: this may bethisinstance (if no changes effected), or a newly constructed instance.
-
without
public final T without(DatatypeFeature feature)
Fluent factory method that will return a configuration object instance with specified feature disabled: this may bethisinstance (if no changes effected), or a newly constructed instance.
-
withoutFeatures
public final T withoutFeatures(DatatypeFeature... features)
Fluent factory method that will return a configuration object instance with specified features disabled: this may bethisinstance (if no changes effected), or a newly constructed instance.
-
with
public final T with(DatatypeFeature feature, boolean state)
Fluent factory method that will construct and return a new configuration object instance with specified features disabled.
-
with
public final T with(AnnotationIntrospector ai)
Method for constructing and returning a new instance with differentAnnotationIntrospectorto use (replacing old one).NOTE: make sure to register new instance with
ObjectMapperif directly calling this method.
-
withAppendedAnnotationIntrospector
public final T withAppendedAnnotationIntrospector(AnnotationIntrospector ai)
Method for constructing and returning a new instance with additionalAnnotationIntrospectorappended (as the lowest priority one)
-
withInsertedAnnotationIntrospector
public final T withInsertedAnnotationIntrospector(AnnotationIntrospector ai)
Method for constructing and returning a new instance with additionalAnnotationIntrospectorinserted (as the highest priority one)
-
with
public final T with(ClassIntrospector ci)
Method for constructing and returning a new instance with differentClassIntrospectorto use.NOTE: make sure to register new instance with
ObjectMapperif directly calling this method.
-
with
public abstract T with(ContextAttributes attrs)
Method for constructing an instance that has specified contextual attributes.- Since:
- 2.3
-
withAttributes
public T withAttributes(java.util.Map<?,?> attributes)
Method for constructing an instance that has only specified attributes, removing any attributes that exist before the call.- Since:
- 2.3
-
withAttribute
public T withAttribute(java.lang.Object key, java.lang.Object value)
Method for constructing an instance that has specified value for attribute for given key.- Since:
- 2.3
-
withoutAttribute
public T withoutAttribute(java.lang.Object key)
Method for constructing an instance that has no value for attribute for given key.- Since:
- 2.3
-
with
public final T with(TypeFactory tf)
Method for constructing and returning a new instance with differentTypeFactoryto use.
-
with
public final T with(TypeResolverBuilder<?> trb)
Method for constructing and returning a new instance with differentTypeResolverBuilderto use.
-
with
public final T with(PropertyNamingStrategy pns)
Method for constructing and returning a new instance with differentPropertyNamingStrategyto use.NOTE: make sure to register new instance with
ObjectMapperif directly calling this method.
-
with
public final T with(AccessorNamingStrategy.Provider p)
Method for constructing and returning a new instance with differentPropertyNamingStrategyto use.- Since:
- 2.12
-
with
public final T with(HandlerInstantiator hi)
Method for constructing and returning a new instance with differentHandlerInstantiatorto use.NOTE: make sure to register new instance with
ObjectMapperif directly calling this method.
-
with
public T with(CacheProvider provider)
- Since:
- 2.16
-
with
public final T with(Base64Variant base64)
Method for constructing and returning a new instance with different defaultBase64Variantto use with base64-encoded binary values.
-
with
public T with(java.text.DateFormat df)
Method for constructing and returning a new instance with differentDateFormatto use.NOTE: non-final since
SerializationConfigneeds to override this
-
with
public final T with(java.util.Locale l)
Method for constructing and returning a new instance with different defaultLocaleto use for formatting.
-
with
public final T with(java.util.TimeZone tz)
Method for constructing and returning a new instance with different defaultTimeZoneto use for formatting of date values.
-
withRootName
public abstract T withRootName(PropertyName rootName)
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
SerializationFeatureto determine if to use wrapping, and annotation (or default name) for actual root name to use.- Parameters:
rootName- 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.- Since:
- 2.6
-
withRootName
public T withRootName(java.lang.String rootName)
-
with
public abstract T with(SubtypeResolver str)
Method for constructing and returning a new instance with differentSubtypeResolverto use.NOTE: make sure to register new instance with
ObjectMapperif directly calling this method.
-
withView
public abstract T withView(java.lang.Class<?> view)
Method for constructing and returning a new instance with different view to use.
-
getDatatypeFeatures
public final DatatypeFeatures getDatatypeFeatures()
- Specified by:
getDatatypeFeaturesin classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
getSubtypeResolver
public final SubtypeResolver getSubtypeResolver()
Accessor for object used for finding out all reachable subtypes for supertypes; needed when a logical type name is used instead of class name (or custom scheme).- Specified by:
getSubtypeResolverin classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
getRootName
@Deprecated public final java.lang.String getRootName()
Deprecated.Since 2.6 usegetFullRootName()instead.
-
getFullRootName
public final PropertyName getFullRootName()
- Since:
- 2.6
-
getActiveView
public final java.lang.Class<?> getActiveView()
Description copied from class:MapperConfigAccessor for finding currently active view, if any (null if none)- Specified by:
getActiveViewin classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
getAttributes
public final ContextAttributes getAttributes()
Description copied from class:MapperConfigMethod for accessing per-instance shared (baseline/default) attribute values; these are used as the basis for per-call attributes.- Specified by:
getAttributesin classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
getConfigOverride
public final ConfigOverride getConfigOverride(java.lang.Class<?> type)
Description copied from class:MapperConfigAccessor for findingConfigOverrideto use for properties of given type, if any exist; or if none, return an immutable "empty" instance with no overrides.Note that only directly associated override is found; no type hierarchy traversal is performed.
- Specified by:
getConfigOverridein classMapperConfig<T extends MapperConfigBase<CFG,T>>- Returns:
- Override object to use for the type, never null (but may be empty)
-
findConfigOverride
public final ConfigOverride findConfigOverride(java.lang.Class<?> type)
Description copied from class:MapperConfigAccessor for findingConfigOverrideto use for properties of given type, if any exist; or return `null` if not.Note that only directly associated override is found; no type hierarchy traversal is performed.
- Specified by:
findConfigOverridein classMapperConfig<T extends MapperConfigBase<CFG,T>>- Returns:
- Override object to use for the type, if defined; null if none.
-
getDefaultPropertyInclusion
public final JsonInclude.Value getDefaultPropertyInclusion()
Description copied from class:MapperConfigAccessor for default property inclusion to use for serialization, used unless overridden by per-type or per-property overrides.- Specified by:
getDefaultPropertyInclusionin classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
getDefaultPropertyInclusion
public final JsonInclude.Value getDefaultPropertyInclusion(java.lang.Class<?> baseType)
Description copied from class:MapperConfigAccessor for default property inclusion to use for serialization, considering possible per-type override for given base type.
NOTE: if no override found, defaults to value returned byMapperConfig.getDefaultPropertyInclusion().- Specified by:
getDefaultPropertyInclusionin classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
getDefaultInclusion
public final JsonInclude.Value getDefaultInclusion(java.lang.Class<?> baseType, java.lang.Class<?> propertyType)
Description copied from class:MapperConfigAccessor for default property inclusion to use for serialization, considering possible per-type override for given base type and possible per-type override for given property type.
NOTE: if no override found, defaults to value returned byMapperConfig.getDefaultPropertyInclusion().- Specified by:
getDefaultInclusionin classMapperConfig<T extends MapperConfigBase<CFG,T>>- Parameters:
baseType- Type of the instance containing the targeted property.propertyType- Type of the property to look up inclusion setting for.
-
getDefaultPropertyFormat
public final JsonFormat.Value getDefaultPropertyFormat(java.lang.Class<?> type)
Description copied from class:MapperConfigAccessor for default format settings to use for serialization (and, to a degree deserialization), considering baseline settings and per-type defaults for given base type (if any).- Specified by:
getDefaultPropertyFormatin classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
getDefaultPropertyIgnorals
public final JsonIgnoreProperties.Value getDefaultPropertyIgnorals(java.lang.Class<?> type)
Description copied from class:MapperConfigAccessor for default property ignorals to use, if any, for given base type, based on config overrides settings (seeMapperConfig.findConfigOverride(Class)).- Specified by:
getDefaultPropertyIgnoralsin classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
getDefaultPropertyIgnorals
public final JsonIgnoreProperties.Value getDefaultPropertyIgnorals(java.lang.Class<?> baseType, AnnotatedClass actualClass)
Description copied from class:MapperConfigHelper method that may be called to see if there are property ignoral definitions from annotations (viaAnnotatedClass) or through "config overrides". If both exist, config overrides have precedence over class annotations.- Specified by:
getDefaultPropertyIgnoralsin classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
getDefaultPropertyInclusions
public final JsonIncludeProperties.Value getDefaultPropertyInclusions(java.lang.Class<?> baseType, AnnotatedClass actualClass)
Description copied from class:MapperConfigHelper method that may be called to see if there are property inclusion definitions from annotations (viaAnnotatedClass). TODO: config override.- Specified by:
getDefaultPropertyInclusionsin classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
getDefaultVisibilityChecker
public final VisibilityChecker<?> getDefaultVisibilityChecker()
Description copied from class:MapperConfigAccessor for object used for determining whether specific property elements (method, constructors, fields) can be auto-detected based on their visibility (access modifiers). Can be changed to allow different minimum visibility levels for auto-detection. Note that this is the global handler; individual types (classes) can further override active checker used (usingJsonAutoDetectannotation)- Specified by:
getDefaultVisibilityCheckerin classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
getDefaultVisibilityChecker
public final VisibilityChecker<?> getDefaultVisibilityChecker(java.lang.Class<?> baseType, AnnotatedClass actualClass)
Description copied from class:MapperConfigAccessor for object used for determining whether specific property elements (method, constructors, fields) can be auto-detected based on their visibility (access modifiers). This is based on global defaults (as would be returned byMapperConfig.getDefaultVisibilityChecker(), but then modified by possible class annotation (seeJsonAutoDetect) and/or per-type config override (seeConfigOverride.getVisibility()).- Specified by:
getDefaultVisibilityCheckerin classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
getDefaultSetterInfo
public final JsonSetter.Value getDefaultSetterInfo()
Description copied from class:MapperConfigAccessor for the baseline setter info used as the global baseline, not considering possible per-type overrides.- Specified by:
getDefaultSetterInfoin classMapperConfig<T extends MapperConfigBase<CFG,T>>- Returns:
- Global base settings; never null
-
getDefaultMergeable
public java.lang.Boolean getDefaultMergeable()
Description copied from class:MapperConfigAccessor for the baseline merge info used as the global baseline, not considering possible per-type overrides.- Specified by:
getDefaultMergeablein classMapperConfig<T extends MapperConfigBase<CFG,T>>- Returns:
- Global base settings, if any; `null` if none.
-
getDefaultMergeable
public java.lang.Boolean getDefaultMergeable(java.lang.Class<?> baseType)
Description copied from class:MapperConfigAccessor for the baseline merge info used for given type, including global defaults if no type-specific overrides defined.- Specified by:
getDefaultMergeablein classMapperConfig<T extends MapperConfigBase<CFG,T>>- Returns:
- Type-specific settings (if any); global defaults (same as
MapperConfig.getDefaultMergeable()) otherwise, if any defined; or `null` if neither defined
-
findRootName
public PropertyName findRootName(JavaType rootType)
- Specified by:
findRootNamein classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
findRootName
public PropertyName findRootName(java.lang.Class<?> rawRootType)
- Specified by:
findRootNamein classMapperConfig<T extends MapperConfigBase<CFG,T>>
-
findMixInClassFor
public final java.lang.Class<?> findMixInClassFor(java.lang.Class<?> cls)
Method that will check if there are "mix-in" classes (with mix-in annotations) for given class- Specified by:
findMixInClassForin interfaceClassIntrospector.MixInResolver
-
copy
public ClassIntrospector.MixInResolver copy()
Description copied from interface:ClassIntrospector.MixInResolverMethod called to create a new, non-shared copy, to be used by differentObjectMapperinstance, and one that should not be connected to this instance, if resolver has mutable state. If resolver is immutable may simply return `this`.- Specified by:
copyin interfaceClassIntrospector.MixInResolver
-
mixInCount
public final int mixInCount()
Test-only method -- does not reflect possibly open-ended set that external mix-in resolver might provide.
-
-