For a specific property type (such as MyType), I want to serialize it to diff output base on what Bean it define in.
class A {
MyType t;
}
class B {
MyType t;
}
Want to serialize A.t to value1, B.t to value2 base on the type of A or B. I found ContextualSerializer
interface JsonSerializer<?> createContextual(SerializerProvider prov, BeanProperty property)
. The BeanProperty
just can get the property type and name but no context Bean type info.
Pease help me to figure out the way?