I have a rest web service written in spring mvc and using jackson json for the output. To ignore an object while serialising to json, I know I can annotate the field or class with @Jsonignore. But I have an array of objects the I want to return and whether to ignore some objects from the final json output depends on some condition. For example: ignore if the object.hasTitle() == null.
What would be the best way to achieve this in spring mvc?