I have a Java POJO. Few properties are there along with a list<>. While converting this object to JSON String, I want to exclude the list property, So what annotation to use for that?
public class StudentResultSummary {
private String totMarks;
private String avgMarks;
private List<StudentResult> resultList = new ArrayList<StudentResult>();
}
Convert to JSON:
StudentResultSummary resultSummary = new StudentResultSummary();
Json json = new Json();
policySummary = json.encode(resultSummary);
How can I make sure the field resultList is not included as part of the JSON response?