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.
Come to think of this, I think we can have parallel effort for 2.x, whereupon one can
- Start build process with setting of another 
ObjectMapper(to copy settings) - Allow 
new SmileMapper(ObjectMapper src)as well. 
As to 3.0, I suspect idea of rebuildWith(TokenStreamFactory) wouldn't work, but it'd rather have to be something like
SmileMapper.builder(TokenStreamFactory, ObjectMapper)
                                    
                                    
                                    
                                
Will not pursue this, due to more format-specific constraints between mappers and TokenStreamFactory instances.