Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.0.0
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Currently (1.9.0) Module.SetupContext only has accessor method for getting SerializationConfig/DeserializationConfig instances. This allows changing of feature settings currently; but due to plans to make these objects immutable (and replace setters with withXxx() fluent constructors) this will not work in future.
But there aren't alternative non-deprecated modification methods available yet.
Solved this problem bit differently: added
Module.SetupContext
{ public ObjectCodec getOwner(); }which gives full (unsafe!) access to mapper itself; this way brave modules can try to actually modify state of ObjectMapper itself, including modifying features.
Modules are discouraged to do this – all intended access should be via safe methods – but this fallback should allow workarounds in wide variety of cases, including that of changing feature states.