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

Allow overriding construction of `ValueInjector`s, to support better access to configuration, overrides

Open cowtowncoder opened this issue 5 years ago • 0 comments

(see #/1835 for background)

Currently ability to "inject" values (usually per-call contextual values, either for accessing other information (lookups), or for simple substitution from attributes) is severely limited: you can indicate that value for a property should be injectable (see AnnotationIntrospector method findInjectableValue()), but after that, handling is limited by ValueInjector implementation that delegates lookups through DeserializationContext.findInjectableValue(). This works for many cases, but not all, nor does it lend itself to customizations.

As per #1835 there are cases where overload of BeanDeserializerFactory.addInjectable() is used to customize handling. It seems better to allow registering a factory/handler (or, add a new method in one of existing ones, if any applicable?), since that would then become public API, supported and less fragile.

I'll tentatively mark this as 2.10 feature, although it is possible this might end up in 3.x list.

cowtowncoder avatar Aug 31 '18 00:08 cowtowncoder