I am using JSON Jackson to convert from POJOs to JSON. I am using
mapper.writeValueAsString(s);
It is working fine. Problem is I dont’t want to convert all class varaibles into JSON. Anyone kno whow to do it; is there any function for ObjectMapper in which we can specify don’t convert this class varaible into JSON.
Annotate fields you want to ignore with
@JsonIgnore(JavaDoc).