jackson-databind
jackson-databind copied to clipboard
Allow construction of "format-bending" `ObjectMapper.Builder`s?
(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.