JSTEP 8 - FasterXML/jackson-future-ideas GitHub Wiki

(Back to JSTEP page)

Refactoring of format-specific read/write features for Jackson 3

Author

Tatu Saloranta (@cowtowncoder)

Version history

  • 2024-11-20: first and definitive version

Status

Work completed on 2024-11-20.

Overview

As of Jackson 2.x, format-specific features have been typically added as inner-class Enums of format-specific parsers/generators: for example, Avro module (jackson-dataformat-avro) has:

  • AvroParser.Feature for reader-side on/off features
  • AvroGenerator.Feature for writer-side on/off features

Not all formats have such features (and some only reader- or writer-side ones), but all follow the same pattern. This was modeled based on original JsonParser.Feature (mix of JSON-specific and general features), JsonGenerator.Feature approach. Jackson 2.10, however, split JsonParser.Feature into 2 sets of Features:

  • StreamReadFeature for general-purpose (cross-format, non-JSON-specific) features
  • JsonReadFeature for JSON-specific features

While there is no confusion on format-specific/general features outside of JSON package, it seems ideal to follow same naming convention, so that:

  • AvroParser.Feature becomes AvroReadFeature
  • AvroGenerator.Feature becomes AvroWriteFeature

Changes by component

Here are issues created for work on this JSTEP, by format module: