jackson-databind icon indicating copy to clipboard operation
jackson-databind copied to clipboard

Allow construction of "format-bending" `ObjectMapper.Builder`s?

Open cowtowncoder opened this issue 4 years ago • 1 comments

(note: continuation from https://github.com/FasterXML/jackson-dataformats-binary/issues/205)

Sometimes it would be valuable to be able to construct ObjectMapper types with different backing format: for example, based on JsonMapper, create a SmileMapper using shared applicable format-agnostic configurations. Currently there is no way to do that, since TokenStreamFactory can not be changed either for ObjectMapper (fully immutable since 3.0, but not changeable even in 2.x), or for ObjectMapper.Builder (which is constructed passing one).

But it seems possible to allow use of

ObjectMapper.rebuildWith(TokenStreamFactory)

which could then copy subset of configuration that is shared between ObjectMapper, dropping format-specific configuration.

cowtowncoder avatar May 16 '20 00:05 cowtowncoder