forked from FasterXML/jackson
-
Notifications
You must be signed in to change notification settings - Fork 0
Jackson Release 3.0
Kim, Joo Hyuk edited this page Oct 12, 2023
·
3 revisions
Version 3.0 is under development, as of March 2021 (and since late 2017).
It is a major version update and thereby not API compatible with 2.x; however, since 2.10 new methods have been added in 2.x line to reduce incompatibilities.
Overall plans are outlined in JSTEP-1
Java 8 is now required for all components.
- Removal of all deprecated methods, functionality, as of 2.x
- Remove format-auto-detection (interesting idea but not widely used and few formats beyond JSON, XML, Smile, Avro support detection)
- Full immutability of core entities, via Builder-style construction
-
TokenStreamFactory
(oldJsonFactory
) -
ObjectMapper
(addition of format-specific sub-classes, fromJsonMapper
toXmlMapper
) - Note Jackson 2.10 and later will also support most of Builder-style construction but without strict guarantees of immutability of underlying entities (due to backwards-compatibility reasons)
- See Jackson 3 immutability with builders
-
- Tighter integration between Streaming and Databinding to allow improved support of non-JSON formats
-
ObjectMapper
remains shared API, but every format will have its own mapper subtype, includingJsonMapper
for JSON- Partly implemented in 2.x since 2.10, to support Builder-style construction (albeit without immutability)
- Format-specific mapper will (have to) use format-specific
TokenStreamFactory
-
- Unchecked exceptions (see JSTEP-4
- Base 2.x exceptions will be replaced with new counterparts as follows (counterparts will be added in 2.x but mostly used in 3.0)
-
JsonProcessingException
(root exception) becomesJacksonException
-
JsonParseException
/JsonGenerationException
(streaming) will becomeStreamReadException
/StreamWriteException
-
JsonMappingException
(root for databind exceptions) becomesDatabindException
- While new exceptions will be added by Jackson 2.13, their use is limited: they CAN be caught but NOT thrown (sort of "read-only" upgrade) while retaining compatibility across minor versions
-
#378: Change default for
TokenStreamFactory.Feature.INTERN_FIELD_NAMES
tofalse
- #402: Remove dataformat-auto-detection functionality
-
#411: Rename
JsonStreamContext
asTokenStreamContext
-
#413: Remove
ObjectCodec
: replace withObjectWriteContext
/ObjectReadContext
-
#432: Add new
TreeNode
subtypes:ArrayTreeNode
,ObjectTreeNode
- #433: Add Builder pattern for creating configured Stream factories
-
#456: Add
JsonParser.readAsValue(ResolvedType)
- #492: Ensure primitive type names in error message enclosed in backticks
-
#551: Remove
JsonGenerator.setPrettyPrinter()
from 3.0 -
#663: Rename
JsonEOFException
asUnexpectedEndOfInputException
-
#670: Replace references to "field" in
JsonGenerator
,JsonParser
method names with "property" -
#671: Replace
getCurrentLocation()
/getTokenLocation()
withcurrentLocation()
/currentTokenLocation()
-
#676: Remove
JsonGenerator.canWriteBinaryNatively()
,canWriteFormattedNumbers()
(replaced byStreamWriteCapability
equivalents) -
#680: Allow use of
java.nio.file.Path
as parser source, generator target - #689: Remove existing "request payload" functionality
-
#785: Make
JsonGenerator.writeXxx()
methods chainable - #793: Rename "com.fasterxml.jackson" -> "tools.jackson"
- Rename
JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT
asAUTO_CLOSE_CONTENT
- Add
TreeCodec.nullNode()
,TreeNode.isNull()
methods - Change the way
JsonLocation.NA
is included in exception messages
-
#1772: Remove
MapperFeature. USE_STD_BEAN_NAMING
-
#1773: Remove
MapperFeature.AUTO_DETECT_xxx
features -
#1917: Remove
canSerialize
andcanDeserialize
methods fromObjectMapper
-
#1973: Remove support for "default [Map] key serializer" configuration from
SerializerProvider
-
#2040: Remove
JsonSerializer.isEmpty()
- Remove
MappingJsonFactory
- #1600: Serializing locale with underscore, not standard hyphen
-
#1762:
StdDateFormat
: serialize time offset using colon -
#1774: Merge Java8 datatype (
Optional
,Stream
) support in core databind -
#1775: Merge Java8 parameter name support (
jackson-module-parameter-names
) in core databind -
#1781: Return
ObjectNode
fromObjectNode
set-methods in order to allow better chaining - #:
-
#1888: Merge
ResolvableSerializer
intoJsonSerializer
,ResolvableDeserializer
intoJsonDeserializer
-
#1889: Merge
ContextualSerializer
intoJsonSerializer
,ContextualDeserializer
intoJsonDeserializer
-
#1916: Change
MapperFeature.USE_GETTERS_AS_SETTERS)
default tofalse
-
#1994: Limit size of
SerializerCache
, auto-flush on exceeding -
#1995: Limit size of
DeserializerCache
, auto-flush on exceeding -
#2177: Change parent type of
JsonProcessingException
to beRuntimeException
-
#2713: Change wording of
UnrecognizedPropertyException
to refer to "property" not "field" -
#3028: Change
UUIDSerializer
to useStreamWriteCapability
check instead ofJsonGenerator.canWriteBinaryNatively()
-
#3037: Rename
Module
asJacksonModule
in 3.0 (to avoid overlap withjava.lang.Module
)
-
#1789: Add
createGenerator
methods inObjectMapper
,ObjectWriter
-
#1790: Add
createParser
methods inObjectMapper
,ObjectReader
-
#1883: Add "abstract type mapping" for deserialization from
Map<ENUMTYPE,V>
intoEnumMap
(andSet<ENUMTYPE>
toEnumSet<EnumType>
) -
#1954: Add Builder pattern for creating configured
ObjectMapper
instances -
#1955: Change the way
Module
s configure, interact withObjectMapper
-
#2013: Allow use of
java.nio.file.Path
forreadValue()
,writeValue()
-
#2411:
valueToTree()
during serialization (viaSerializerProvider()
) -
#2828: Add
DatabindException
as intermediate subtype ofJsonMappingException
-
#3536: Create new exception type
JsonNodeException
for use byJsonNode
-related problems