Module interface is stateless, one-of-thing, so it does not have default wiring to affect things it adds.
But what you can do is to use a work-around; possibilities include:
- use of
ThreadLocal
; set before serialization, read from serializer
- use new (Jackson 2.3) feature of "attributes"; can set those for writing (
ObjectWriter.setAttribute()
) and reading (ObjectReader.setAttribute()
), accessible by serializer/deserializer through context object (SerializerProvider
/ DeserializationContext
)
So hopefully one of these works for your use case.