Is there currently any way to reference parent objects' property values from within a custom serializer/deserializer?
For example, given the following structure:
class Parent {
@SomeAnno1
String id;
@SomeAnno2
Date createDate;
OtherClass child;
}
class OtherClass {
@AnnotationToTriggerCustomSerializer
String value;
}
What I need, is during serialization and deserialization of OtherClass.value, to get the values of parent fields with the @SomeAnno1 and @SomeAnno2 (in this case id and createDate) in order to properly serialize the value. I do not want to have a custom serializer assigned to Parent.id and Parent.createDate because those fields may already have serializers that I don't want to affect.
I've seen notes about using the new contextual attributes, but haven't been able to get this to actually work for me. Is this possible?
Thanks!