I'm trying to extend the com.fasterxml.jackson.databind.ser.std.MapSerializer to include some of my own defined functions to be used in serialize() method.
public class MyMapSerializer extends MapSerializer{
//have constructors
//override method
@Override
public void serialize(Map<?,?> value, JsonGenerator jgen, SerializerProvider provider){}
}
Then I add the annotation to my map as folllowing:
@JsonSerialize(using = org.entities.generator.MyMapSerializer.class)
private Map<ObjectA,ObjectB> myObject;
But when I add a breakpoint in the MapSerializer, it does not even go into it. And I tried to extend JsonSerializer>, it goes into it. Anyone knows how to use the extended MapSerializer? Thanks for the help