Uses of Class
com.fasterxml.jackson.databind.ObjectMapper
Packages that use ObjectMapper
Package
Description
Basic data binding (mapping) functionality that
allows for reading JSON content into Java Objects (POJOs)
and JSON Trees (
JsonNode), as well as
writing Java Objects and trees as JSON.Package that contains most of configuration-related classes;
exception being couple of most-commonly used configuration
things (like Feature enumerations) that are at the
main level (
com.fasterxml.jackson.databind).Jackson-based Jakarta-RS provider that can automatically
serialize and deserialize resources for
JSON content type (MediaType).
Implementations of
FormatMapper using Jackson.-
Uses of ObjectMapper in com.fasterxml.jackson.databind
Methods in com.fasterxml.jackson.databind that return ObjectMapperModifier and TypeMethodDescriptionObjectMapper.activateDefaultTyping(PolymorphicTypeValidator ptv) Convenience method that is equivalent to callingObjectMapper.activateDefaultTyping(PolymorphicTypeValidator ptv, ObjectMapper.DefaultTyping applicability) Convenience method that is equivalent to callingObjectMapper.activateDefaultTyping(PolymorphicTypeValidator ptv, ObjectMapper.DefaultTyping applicability, JsonTypeInfo.As includeAs) Method for enabling automatic inclusion of type information ("Default Typing"), needed for proper deserialization of polymorphic types (unless types have been annotated withJsonTypeInfo).ObjectMapper.activateDefaultTypingAsProperty(PolymorphicTypeValidator ptv, ObjectMapper.DefaultTyping applicability, String propertyName) Method for enabling automatic inclusion of type information ("Default Typing") -- needed for proper deserialization of polymorphic types (unless types have been annotated withJsonTypeInfo) -- using "As.PROPERTY" inclusion mechanism and specified property name to use for inclusion (default being "@class" since default type information always uses class name as type identifier)ObjectMapper.addHandler(DeserializationProblemHandler h) Method for adding specifiedDeserializationProblemHandlerto be used for handling specific problems during deserialization.Method to use for adding mix-in annotations to use for augmenting specified class or interface.ObjectMapper.clearProblemHandlers()Method for removing all registeredDeserializationProblemHandlers instances from this mapper.ObjectMapper.configure(JsonGenerator.Feature f, boolean state) Method for changing state of an on/offJsonGeneratorfeature for generator instances this object mapper creates.ObjectMapper.configure(JsonParser.Feature f, boolean state) Method for changing state of specifiedJsonParser.Features for parser instances this object mapper creates.ObjectMapper.configure(DatatypeFeature f, boolean state) Method for changing state of an on/off datatype-specific feature for this object mapper.ObjectMapper.configure(DeserializationFeature f, boolean state) Method for changing state of an on/off deserialization feature for this object mapper.ObjectMapper.configure(MapperFeature f, boolean state) Deprecated.ObjectMapper.configure(SerializationFeature f, boolean state) Method for changing state of an on/off serialization feature for this object mapper.ObjectMapper.copy()Method for creating a newObjectMapperinstance that has same initial configuration as this instance.ObjectMapper.copyWith(JsonFactory factory) Method for creating a newObjectMapper.ObjectMapper.deactivateDefaultTyping()Method for disabling automatic inclusion of type information; if so, only explicitly annotated types (ones withJsonTypeInfo) will have additional embedded type information.ObjectMapper.disable(JsonGenerator.Feature... features) Method for disabling specifiedJsonGenerator.Features for parser instances this object mapper creates.ObjectMapper.disable(JsonParser.Feature... features) Method for disabling specifiedJsonParser.Features for parser instances this object mapper creates.ObjectMapper.disable(DeserializationFeature feature) Method for disabling specifiedDeserializationConfigfeatures.ObjectMapper.disable(DeserializationFeature first, DeserializationFeature... f) Method for disabling specifiedDeserializationConfigfeatures.ObjectMapper.disable(MapperFeature... f) Deprecated.Since 2.13 useJsonMapper.builder().disable(...)ObjectMapper.disable(SerializationFeature f) Method for disabling specifiedDeserializationConfigfeatures.ObjectMapper.disable(SerializationFeature first, SerializationFeature... f) Method for disabling specifiedDeserializationConfigfeatures.ObjectMapper.disableDefaultTyping()Deprecated.Since 2.10 usedeactivateDefaultTyping()insteadObjectMapper.enable(JsonGenerator.Feature... features) Method for enabling specifiedJsonGenerator.Features for parser instances this object mapper creates.ObjectMapper.enable(JsonParser.Feature... features) Method for enabling specifiedJsonParser.Features for parser instances this object mapper creates.ObjectMapper.enable(DeserializationFeature feature) Method for enabling specifiedDeserializationConfigfeatures.ObjectMapper.enable(DeserializationFeature first, DeserializationFeature... f) Method for enabling specifiedDeserializationConfigfeatures.ObjectMapper.enable(MapperFeature... f) Deprecated.Since 2.13 useJsonMapper.builder().enable(...)ObjectMapper.enable(SerializationFeature f) Method for enabling specifiedDeserializationConfigfeature.ObjectMapper.enable(SerializationFeature first, SerializationFeature... f) Method for enabling specifiedDeserializationConfigfeatures.ObjectMapper.enableDefaultTyping()Deprecated.Since 2.10 useactivateDefaultTyping(PolymorphicTypeValidator)insteadObjectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping dti) Deprecated.Since 2.10 useactivateDefaultTyping(PolymorphicTypeValidator,DefaultTyping)insteadObjectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping applicability, JsonTypeInfo.As includeAs) Deprecated.Since 2.10 useactivateDefaultTyping(PolymorphicTypeValidator,DefaultTyping,JsonTypeInfo.As)insteadObjectMapper.enableDefaultTypingAsProperty(ObjectMapper.DefaultTyping applicability, String propertyName) Deprecated.Since 2.10 useactivateDefaultTypingAsProperty(PolymorphicTypeValidator,DefaultTyping,String)insteadObjectMapper.findAndRegisterModules()Convenience method that is functionally equivalent to:mapper.registerModules(mapper.findModules());final ObjectMapperMappingJsonFactory.getCodec()We'll override the method to return more specific type; co-variance helps hereObjectMapper.registerModule(Module module) Method for registering a module that can extend functionality provided by this mapper; for example, by adding providers for custom serializers and deserializers.ObjectMapper.registerModules(Module... modules) Convenience method for registering specified modules in order; functionally equivalent to:ObjectMapper.registerModules(Iterable<? extends Module> modules) Convenience method for registering specified modules in order; functionally equivalent to:ObjectMapper.setAccessorNaming(AccessorNamingStrategy.Provider s) Method for setting custom accessor naming strategy to use.ObjectMapper.setAnnotationIntrospector(AnnotationIntrospector ai) Method for settingAnnotationIntrospectorused by this mapper instance for both serialization and deserialization.ObjectMapper.setAnnotationIntrospectors(AnnotationIntrospector serializerAI, AnnotationIntrospector deserializerAI) Method for changingAnnotationIntrospectorinstances used by this mapper instance for serialization and deserialization, specifying them separately so that different introspection can be used for different aspectsObjectMapper.setBase64Variant(Base64Variant v) Method that will configure defaultBase64Variantthatbyte[]serializers and deserializers will use.ObjectMapper.setCacheProvider(CacheProvider cacheProvider) Method for specifyingCacheProviderinstance, to provide Cache instances to be used in components downstream.ObjectMapper.setConfig(DeserializationConfig config) Method that allows overriding of the underlyingDeserializationConfigobject.ObjectMapper.setConfig(SerializationConfig config) Method that allows overriding of the underlyingSerializationConfigobject, which contains serialization-specific configuration settings.ObjectMapper.setConstructorDetector(ConstructorDetector cd) Method for specifyingConstructorDetectorto use for determining some aspects of creator auto-detection (specifically auto-detection of constructor, and in particular behavior with single-argument constructors).ObjectMapper.setDateFormat(DateFormat dateFormat) Method for configuring the defaultDateFormatto use when serializing time values as Strings, and deserializing from JSON Strings.ObjectMapper.setDefaultAttributes(ContextAttributes attrs) NOTE: preferred way to set the defaults is to useBuilderstyle construction, seeJsonMapper.builder()(andMapperBuilder.defaultAttributes(com.fasterxml.jackson.databind.cfg.ContextAttributes)).ObjectMapper.setDefaultLeniency(Boolean b) ObjectMapper.setDefaultMergeable(Boolean b) Method for setting default Setter configuration, regarding things like merging, null-handling; used for properties for which there are no per-type or per-property overrides (via annotations or config overrides).ObjectMapper.setDefaultPrettyPrinter(PrettyPrinter pp) Method for specifyingPrettyPrinterto use when "default pretty-printing" is enabled (by enablingSerializationFeature.INDENT_OUTPUT)ObjectMapper.setDefaultPropertyInclusion(JsonInclude.Include incl) Short-cut for:ObjectMapper.setDefaultPropertyInclusion(JsonInclude.Value incl) Method for setting default POJO property inclusion strategy for serialization, applied for all properties for which there are no per-type or per-property overrides (via annotations or config overrides).ObjectMapper.setDefaultSetterInfo(JsonSetter.Value v) Method for setting default Setter configuration, regarding things like merging, null-handling; used for properties for which there are no per-type or per-property overrides (via annotations or config overrides).ObjectMapper.setDefaultTyping(TypeResolverBuilder<?> typer) Method for enabling automatic inclusion of type information ("Default Typing"), using specified handler object for determining which types this affects, as well as details of how information is embedded.ObjectMapper.setDefaultVisibility(JsonAutoDetect.Value vis) Method for setting auto-detection visibility definition defaults, which are in effect unless overridden by annotations (likeJsonAutoDetect) or per-type visibility overrides.ObjectMapper.setFilterProvider(FilterProvider filterProvider) Method for configuring this mapper to use specifiedFilterProviderfor mapping Filter Ids to actual filter instances.ObjectMapper.setInjectableValues(InjectableValues injectableValues) Method for configuringInjectableValueswhich used to find values to inject.Method for overriding default locale to use for formatting.ObjectMapper.setMixInResolver(ClassIntrospector.MixInResolver resolver) Method that can be called to specify given resolver for locating mix-in classes to use, overriding directly added mappings.Method to use for defining mix-in annotations to use for augmenting annotations that processable (serializable / deserializable) classes have.ObjectMapper.setNodeFactory(JsonNodeFactory f) Method for specifyingJsonNodeFactoryto use for constructing root level tree nodes (via methodcreateObjectNode()ObjectMapper.setPolymorphicTypeValidator(PolymorphicTypeValidator ptv) Method for specifyingPolymorphicTypeValidatorto use for validating polymorphic subtypes used with explicit polymorphic types (annotation-based), but NOT one with "default typing" (seeactivateDefaultTyping(PolymorphicTypeValidator)for details).ObjectMapper.setPropertyInclusion(JsonInclude.Value incl) Deprecated.ObjectMapper.setPropertyNamingStrategy(PropertyNamingStrategy s) Method for setting custom property naming strategy to use.ObjectMapper.setSerializationInclusion(JsonInclude.Include incl) Convenience method, equivalent to calling:ObjectMapper.setSerializerFactory(SerializerFactory f) Method for setting specificSerializerFactoryto use for constructing (bean) serializers.ObjectMapper.setSerializerProvider(DefaultSerializerProvider p) Method for setting "blueprint"SerializerProviderinstance to use as the base for actual provider instances to use for handling caching ofJsonSerializerinstances.ObjectMapper.setSubtypeResolver(SubtypeResolver str) Method for setting custom subtype resolver to use.ObjectMapper.setTimeZone(TimeZone tz) Method for overriding default TimeZone to use for formatting.ObjectMapper.setTypeFactory(TypeFactory f) Method that can be used to overrideTypeFactoryinstance used by this mapper.ObjectMapper.setVisibility(PropertyAccessor forMethod, JsonAutoDetect.Visibility visibility) Convenience method that allows changing configuration for underlyingVisibilityCheckers, to change details of what kinds of properties are auto-detected.ObjectMapper.setVisibility(VisibilityChecker<?> vc) Method for setting currently configured defaultVisibilityChecker, object used for determining whether given property element (method, field, constructor) can be auto-detected or not.Constructors in com.fasterxml.jackson.databind with parameters of type ObjectMapperModifierConstructorDescriptionMappingJsonFactory(JsonFactory src, ObjectMapper mapper) MappingJsonFactory(ObjectMapper mapper) protectedObjectMapper(ObjectMapper src) Copy-constructor, mostly used to supportcopy().protectedObjectMapper(ObjectMapper src, JsonFactory factory) Copy-constructor, mostly used to supportcopyWith(JsonFactory).protectedObjectReader(ObjectMapper mapper, DeserializationConfig config) Constructor used byObjectMapperfor initial instantiationprotectedObjectReader(ObjectMapper mapper, DeserializationConfig config, JavaType valueType, Object valueToUpdate, FormatSchema schema, InjectableValues injectableValues) Constructor called when a root deserializer should be fetched based on other configuration.protectedObjectWriter(ObjectMapper mapper, SerializationConfig config) Alternative constructor for initial instantiation byObjectMapperprotectedObjectWriter(ObjectMapper mapper, SerializationConfig config, FormatSchema s) Alternative constructor for initial instantiation byObjectMapperprotectedObjectWriter(ObjectMapper mapper, SerializationConfig config, JavaType rootType, PrettyPrinter pp) Constructor used byObjectMapperfor initial instantiation -
Uses of ObjectMapper in com.fasterxml.jackson.databind.cfg
Classes in com.fasterxml.jackson.databind.cfg with type parameters of type ObjectMapperModifier and TypeClassDescriptionclassMapperBuilder<M extends ObjectMapper,B extends MapperBuilder<M, B>> Jackson 3 will introduce fully immutable, builder-based system for constructingObjectMappers.Fields in com.fasterxml.jackson.databind.cfg declared as ObjectMapper -
Uses of ObjectMapper in com.fasterxml.jackson.databind.json
Subclasses of ObjectMapper in com.fasterxml.jackson.databind.json -
Uses of ObjectMapper in com.fasterxml.jackson.jakarta.rs.base
Classes in com.fasterxml.jackson.jakarta.rs.base with type parameters of type ObjectMapperModifier and TypeClassDescriptionclassProviderBase<THIS extends ProviderBase<THIS,MAPPER, EP_CONFIG, MAPPER_CONFIG>, MAPPER extends ObjectMapper, EP_CONFIG extends EndpointConfigBase<EP_CONFIG>, MAPPER_CONFIG extends MapperConfiguratorBase<MAPPER_CONFIG, MAPPER>> -
Uses of ObjectMapper in com.fasterxml.jackson.jakarta.rs.cfg
Classes in com.fasterxml.jackson.jakarta.rs.cfg with type parameters of type ObjectMapperModifier and TypeClassDescriptionclassMapperConfiguratorBase<IMPL extends MapperConfiguratorBase<IMPL,MAPPER>, MAPPER extends ObjectMapper> Helper class used to encapsulate details of configuring anObjectMapperinstance to be used for data binding, as well as accessing it.Fields in com.fasterxml.jackson.jakarta.rs.cfg declared as ObjectMapperModifier and TypeFieldDescriptionprotected MAPPERMapperConfiguratorBase._defaultMapperIf no mapper was specified when constructed, and no configuration calls are made, a default mapper is constructed.protected MAPPERMapperConfiguratorBase._mapperMapper provider was constructed with if any, or that was constructed due to a call to explicitly configure mapper.Methods in com.fasterxml.jackson.jakarta.rs.cfg with parameters of type ObjectMapperModifier and TypeMethodDescriptionprotected final voidMapperConfiguratorBase._setAnnotations(ObjectMapper mapper, Annotations[] annotationsToUse) -
Uses of ObjectMapper in com.fasterxml.jackson.jakarta.rs.json
Methods in com.fasterxml.jackson.jakarta.rs.json that return ObjectMapperModifier and TypeMethodDescriptionprotected ObjectMapperJacksonJsonProvider._locateMapperViaProvider(Class<?> type, MediaType mediaType) JsonMapperConfigurator.getConfiguredMapper()Method that locates, configures and returnsObjectMapperto useJsonMapperConfigurator.getDefaultMapper()protected ObjectMapperJsonMapperConfigurator.mapper()Helper method that will ensure that there is a configurable non-default mapper (constructing an instance if one didn't yet exit), and return that mapper.Constructors in com.fasterxml.jackson.jakarta.rs.json with parameters of type ObjectMapperModifierConstructorDescriptionJacksonJsonProvider(ObjectMapper mapper) JacksonJsonProvider(ObjectMapper mapper, Annotations[] annotationsToUse) Constructor to use when a custom mapper (usually components like serializer/deserializer factories that have been configured) is to be used.JacksonXmlBindJsonProvider(ObjectMapper mapper, Annotations[] annotationsToUse) Constructor to use when a custom mapper (usually components like serializer/deserializer factories that have been configured) is to be used.JsonMapperConfigurator(ObjectMapper mapper, Annotations[] defAnnotations) -
Uses of ObjectMapper in org.hibernate.type.format.jackson
Constructors in org.hibernate.type.format.jackson with parameters of type ObjectMapperModifierConstructorDescriptionJacksonJsonFormatMapper(ObjectMapper objectMapper) JacksonXmlFormatMapper(ObjectMapper objectMapper) -
Uses of ObjectMapper in org.jboss.resteasy.plugins.providers.jackson
Fields in org.jboss.resteasy.plugins.providers.jackson declared as ObjectMapperModifier and TypeFieldDescriptionprotected static final ObjectMapperJackson2JsonpInterceptor.DEFAULT_MAPPERDefaultObjectMapperfor type resolution.protected ObjectMapperJackson2JsonpInterceptor.objectMapperTheObjectMapperused to create typing information.Methods in org.jboss.resteasy.plugins.providers.jackson that return ObjectMapperModifier and TypeMethodDescriptionprotected ObjectMapperResteasyJackson2Provider._locateMapperViaProvider(Class<?> type, MediaType mediaType) protected ObjectMapperJackson2JsonpInterceptor.getObjectMapper(Class<?> type, MediaType mediaType) Search for anObjectMapperfor the given class and mediaTypeMethods in org.jboss.resteasy.plugins.providers.jackson with parameters of type ObjectMapperModifier and TypeMethodDescriptionvoidJackson2JsonpInterceptor.setObjectMapper(ObjectMapper objectMapper) Set an fixObjectMapper.
JsonMapper.builder().configure(...)