jackson-core
jackson-core copied to clipboard
Separate `PrettyPrinter` / `Instantiatable` into instance/supplier
As of Jackson 2.x, PrettyPrinter interface is overloaded with Instantiable "mix-in" -- so PrettyPrinter that is registered is either:
- Used as-is, if impl does not implement
Instantiatable. This works for stateless implementations - If
Instantiatableimplemented,createInstance()called -- instance configured is basically "blueprint"
This is confusing setup, a result of retrofitting to solve a problem after PrettyPrinter was in use.
But with Jackson 3.0 we could and probably should change this to just configure supplier (with help of Java 8 functional interfaces), when configuring factories.
And if leaving method in generator, that can just take a configured/stateless PrettyPrinter instance.