I'm generating POJOs from XSDs using JAXB. And I'm using Jersey/Jackson to serialize the POJOs to JSONs. For the whole project, I've created an ObjectMapper that has Inclusion.NON_NULL
set. But for one particular serialization class, I want to include null values. I know, I have to use Inclusion.ALWAYS
on the POJO to override the ObjectMapper, but the POJO I'm using is generated from XSDs.
Is there a way to add this Jackson's annotation @JsonSerialize(include=Inclusion.ALWAYS)
to that one particular POJO during marshalling?