JsonProperty example


package nl.kameroom.searchservice;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.codehaus.jackson.annotate.JsonProperty;

/**
 * The data tables response.
 */
@SuppressWarnings("serial")
public class DataTablesResponse <T> implements Serializable {
 
 @JsonProperty(value = "sEcho")
 public int echo;
 @JsonProperty(value = "iTotalRecords")
 public int totalRecords;
 @JsonProperty(value = "iTotalDisplayRecords")
 public int totalDisplayRecords;
 @SuppressWarnings("unused")
 @JsonProperty(value = "messages")
 private String[] messages;
 @JsonProperty(value = "aaData")
 public List<T> aaData = new ArrayList<T>();

 public void setMessages(String[] messages) {
 this.messages = messages;
 }
 
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s