Package | Description |
---|---|
com.fasterxml.jackson.databind |
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. |
com.fasterxml.jackson.databind.cfg |
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 ). |
com.fasterxml.jackson.databind.json |
Modifier and Type | Method and Description |
---|---|
ObjectMapper |
ObjectMapper.activateDefaultTyping(PolymorphicTypeValidator ptv)
Convenience method that is equivalent to calling
|
ObjectMapper |
ObjectMapper.activateDefaultTyping(PolymorphicTypeValidator ptv,
ObjectMapper.DefaultTyping applicability)
Convenience method that is equivalent to calling
|
ObjectMapper |
ObjectMapper.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 with
JsonTypeInfo ). |
ObjectMapper |
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 with
JsonTypeInfo ) --
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 |
ObjectMapper.addHandler(DeserializationProblemHandler h)
Method for adding specified
DeserializationProblemHandler
to be used for handling specific problems during deserialization. |
ObjectMapper |
ObjectMapper.addMixIn(Class<?> target,
Class<?> mixinSource)
Method to use for adding mix-in annotations to use for augmenting
specified class or interface.
|
ObjectMapper |
ObjectMapper.clearProblemHandlers()
Method for removing all registered
DeserializationProblemHandler s
instances from this mapper. |
ObjectMapper |
ObjectMapper.configure(DeserializationFeature f,
boolean state)
Method for changing state of an on/off deserialization feature for
this object mapper.
|
ObjectMapper |
ObjectMapper.configure(JsonGenerator.Feature f,
boolean state)
Method for changing state of an on/off
JsonGenerator feature for
generator instances this object mapper creates. |
ObjectMapper |
ObjectMapper.configure(JsonParser.Feature f,
boolean state)
Method for changing state of specified
JsonParser.Feature s
for parser instances this object mapper creates. |
ObjectMapper |
ObjectMapper.configure(MapperFeature f,
boolean state)
Deprecated.
Since 2.13 use
JsonMapper.builder().configure(...) |
ObjectMapper |
ObjectMapper.configure(SerializationFeature f,
boolean state)
Method for changing state of an on/off serialization feature for
this object mapper.
|
ObjectMapper |
ObjectMapper.copy()
Method for creating a new
ObjectMapper instance that
has same initial configuration as this instance. |
ObjectMapper |
ObjectMapper.deactivateDefaultTyping()
Method for disabling automatic inclusion of type information; if so, only
explicitly annotated types (ones with
JsonTypeInfo ) will have
additional embedded type information. |
ObjectMapper |
ObjectMapper.disable(DeserializationFeature feature)
Method for enabling specified
DeserializationConfig features. |
ObjectMapper |
ObjectMapper.disable(DeserializationFeature first,
DeserializationFeature... f)
Method for enabling specified
DeserializationConfig features. |
ObjectMapper |
ObjectMapper.disable(JsonGenerator.Feature... features)
Method for disabling specified
JsonGenerator.Feature s
for parser instances this object mapper creates. |
ObjectMapper |
ObjectMapper.disable(JsonParser.Feature... features)
Method for disabling specified
JsonParser.Feature s
for parser instances this object mapper creates. |
ObjectMapper |
ObjectMapper.disable(MapperFeature... f)
Deprecated.
Since 2.13 use
JsonMapper.builder().disable(...) |
ObjectMapper |
ObjectMapper.disable(SerializationFeature f)
Method for enabling specified
DeserializationConfig features. |
ObjectMapper |
ObjectMapper.disable(SerializationFeature first,
SerializationFeature... f)
Method for enabling specified
DeserializationConfig features. |
ObjectMapper |
ObjectMapper.disableDefaultTyping()
Deprecated.
Since 2.10 use
deactivateDefaultTyping() instead |
ObjectMapper |
ObjectMapper.enable(DeserializationFeature feature)
Method for enabling specified
DeserializationConfig features. |
ObjectMapper |
ObjectMapper.enable(DeserializationFeature first,
DeserializationFeature... f)
Method for enabling specified
DeserializationConfig features. |
ObjectMapper |
ObjectMapper.enable(JsonGenerator.Feature... features)
Method for enabling specified
JsonGenerator.Feature s
for parser instances this object mapper creates. |
ObjectMapper |
ObjectMapper.enable(JsonParser.Feature... features)
Method for enabling specified
JsonParser.Feature s
for parser instances this object mapper creates. |
ObjectMapper |
ObjectMapper.enable(MapperFeature... f)
Deprecated.
Since 2.13 use
JsonMapper.builder().enable(...) |
ObjectMapper |
ObjectMapper.enable(SerializationFeature f)
Method for enabling specified
DeserializationConfig feature. |
ObjectMapper |
ObjectMapper.enable(SerializationFeature first,
SerializationFeature... f)
Method for enabling specified
DeserializationConfig features. |
ObjectMapper |
ObjectMapper.enableDefaultTyping()
Deprecated.
Since 2.10 use
activateDefaultTyping(PolymorphicTypeValidator) instead |
ObjectMapper |
ObjectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping dti)
Deprecated.
Since 2.10 use
activateDefaultTyping(PolymorphicTypeValidator,DefaultTyping) instead |
ObjectMapper |
ObjectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping applicability,
JsonTypeInfo.As includeAs)
Deprecated.
Since 2.10 use
activateDefaultTyping(PolymorphicTypeValidator,DefaultTyping,JsonTypeInfo.As) instead |
ObjectMapper |
ObjectMapper.enableDefaultTypingAsProperty(ObjectMapper.DefaultTyping applicability,
String propertyName)
Deprecated.
Since 2.10 use
activateDefaultTypingAsProperty(PolymorphicTypeValidator,DefaultTyping,String) instead |
ObjectMapper |
ObjectMapper.findAndRegisterModules()
Convenience method that is functionally equivalent to:
mapper.registerModules(mapper.findModules());
|
ObjectMapper |
MappingJsonFactory.getCodec()
We'll override the method to return more specific type; co-variance
helps here
|
ObjectMapper |
ObjectMapper.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 |
ObjectMapper.registerModules(Iterable<? extends Module> modules)
Convenience method for registering specified modules in order;
functionally equivalent to:
|
ObjectMapper |
ObjectMapper.registerModules(Module... modules)
Convenience method for registering specified modules in order;
functionally equivalent to:
|
ObjectMapper |
ObjectMapper.setAccessorNaming(AccessorNamingStrategy.Provider s)
Method for setting custom accessor naming strategy to use.
|
ObjectMapper |
ObjectMapper.setAnnotationIntrospector(AnnotationIntrospector ai)
Method for setting
AnnotationIntrospector used by this
mapper instance for both serialization and deserialization. |
ObjectMapper |
ObjectMapper.setAnnotationIntrospectors(AnnotationIntrospector serializerAI,
AnnotationIntrospector deserializerAI)
Method for changing
AnnotationIntrospector instances used
by this mapper instance for serialization and deserialization,
specifying them separately so that different introspection can be
used for different aspects |
ObjectMapper |
ObjectMapper.setBase64Variant(Base64Variant v)
Method that will configure default
Base64Variant that
byte[] serializers and deserializers will use. |
ObjectMapper |
ObjectMapper.setConfig(DeserializationConfig config)
Method that allows overriding of the underlying
DeserializationConfig
object. |
ObjectMapper |
ObjectMapper.setConfig(SerializationConfig config)
Method that allows overriding of the underlying
SerializationConfig
object, which contains serialization-specific configuration settings. |
ObjectMapper |
ObjectMapper.setConstructorDetector(ConstructorDetector cd)
Method for specifying
ConstructorDetector to use for
determining some aspects of creator auto-detection (specifically
auto-detection of constructor, and in particular behavior with
single-argument constructors). |
ObjectMapper |
ObjectMapper.setDateFormat(DateFormat dateFormat)
Method for configuring the default
DateFormat to use when serializing time
values as Strings, and deserializing from JSON Strings. |
ObjectMapper |
ObjectMapper.setDefaultAttributes(ContextAttributes attrs)
NOTE: preferred way to set the defaults is to use
Builder style
construction, see JsonMapper.builder()
(and MapperBuilder.defaultAttributes(com.fasterxml.jackson.databind.cfg.ContextAttributes) ). |
ObjectMapper |
ObjectMapper.setDefaultLeniency(Boolean b) |
ObjectMapper |
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 |
ObjectMapper.setDefaultPrettyPrinter(PrettyPrinter pp)
Method for specifying
PrettyPrinter to use when "default pretty-printing"
is enabled (by enabling SerializationFeature.INDENT_OUTPUT ) |
ObjectMapper |
ObjectMapper.setDefaultPropertyInclusion(JsonInclude.Include incl)
Short-cut for:
|
ObjectMapper |
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 |
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 |
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 |
ObjectMapper.setDefaultVisibility(JsonAutoDetect.Value vis)
Method for setting auto-detection visibility definition
defaults, which are in effect unless overridden by
annotations (like
JsonAutoDetect ) or per-type
visibility overrides. |
ObjectMapper |
ObjectMapper.setFilterProvider(FilterProvider filterProvider)
Method for configuring this mapper to use specified
FilterProvider for
mapping Filter Ids to actual filter instances. |
ObjectMapper |
ObjectMapper.setInjectableValues(InjectableValues injectableValues)
Method for configuring
InjectableValues which used to find
values to inject. |
ObjectMapper |
ObjectMapper.setLocale(Locale l)
Method for overriding default locale to use for formatting.
|
ObjectMapper |
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.
|
ObjectMapper |
ObjectMapper.setMixIns(Map<Class<?>,Class<?>> sourceMixins)
Method to use for defining mix-in annotations to use for augmenting
annotations that processable (serializable / deserializable)
classes have.
|
ObjectMapper |
ObjectMapper.setNodeFactory(JsonNodeFactory f)
Method for specifying
JsonNodeFactory to use for
constructing root level tree nodes (via method
createObjectNode() |
ObjectMapper |
ObjectMapper.setPolymorphicTypeValidator(PolymorphicTypeValidator ptv)
Method for specifying
PolymorphicTypeValidator to use for validating
polymorphic subtypes used with explicit polymorphic types (annotation-based),
but NOT one with "default typing" (see activateDefaultTyping(PolymorphicTypeValidator)
for details). |
ObjectMapper |
ObjectMapper.setPropertyInclusion(JsonInclude.Value incl)
Deprecated.
|
ObjectMapper |
ObjectMapper.setPropertyNamingStrategy(PropertyNamingStrategy s)
Method for setting custom property naming strategy to use.
|
ObjectMapper |
ObjectMapper.setSerializationInclusion(JsonInclude.Include incl)
Convenience method, equivalent to calling:
|
ObjectMapper |
ObjectMapper.setSerializerFactory(SerializerFactory f)
Method for setting specific
SerializerFactory to use
for constructing (bean) serializers. |
ObjectMapper |
ObjectMapper.setSerializerProvider(DefaultSerializerProvider p)
Method for setting "blueprint"
SerializerProvider instance
to use as the base for actual provider instances to use for handling
caching of JsonSerializer instances. |
ObjectMapper |
ObjectMapper.setSubtypeResolver(SubtypeResolver str)
Method for setting custom subtype resolver to use.
|
ObjectMapper |
ObjectMapper.setTimeZone(TimeZone tz)
Method for overriding default TimeZone to use for formatting.
|
ObjectMapper |
ObjectMapper.setTypeFactory(TypeFactory f)
Method that can be used to override
TypeFactory instance
used by this mapper. |
ObjectMapper |
ObjectMapper.setVisibility(PropertyAccessor forMethod,
JsonAutoDetect.Visibility visibility)
Convenience method that allows changing configuration for
underlying
VisibilityChecker s, to change details of what kinds of
properties are auto-detected. |
ObjectMapper |
ObjectMapper.setVisibility(VisibilityChecker<?> vc)
Method for setting currently configured default
VisibilityChecker ,
object used for determining whether given property element
(method, field, constructor) can be auto-detected or not. |
Constructor and Description |
---|
MappingJsonFactory(JsonFactory src,
ObjectMapper mapper) |
MappingJsonFactory(ObjectMapper mapper) |
ObjectMapper(ObjectMapper src)
Copy-constructor, mostly used to support
copy() . |
ObjectReader(ObjectMapper mapper,
DeserializationConfig config)
Constructor used by
ObjectMapper for initial instantiation |
ObjectReader(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.
|
ObjectWriter(ObjectMapper mapper,
SerializationConfig config)
Alternative constructor for initial instantiation by
ObjectMapper |
ObjectWriter(ObjectMapper mapper,
SerializationConfig config,
FormatSchema s)
Alternative constructor for initial instantiation by
ObjectMapper |
ObjectWriter(ObjectMapper mapper,
SerializationConfig config,
JavaType rootType,
PrettyPrinter pp)
Constructor used by
ObjectMapper for initial instantiation |
Modifier and Type | Class and Description |
---|---|
class |
MapperBuilder<M extends ObjectMapper,B extends MapperBuilder<M,B>>
Jackson 3 will introduce fully immutable, builder-based system for constructing
ObjectMapper s. |
Modifier and Type | Field and Description |
---|---|
protected M |
MapperBuilder._mapper |
Modifier and Type | Class and Description |
---|---|
class |
JsonMapper
JSON-format specific
ObjectMapper implementation. |
Copyright © 2008–2021 FasterXML. All rights reserved.