package com.newvideo.adapter; import java.lang.reflect.Type; import net.sf.json.JSONObject; import com.google.gson.JsonElement; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; import com.newvideo.domain.FindVideo; public class FindVideoAdminAdapter implements JsonSerializer{ @Override public JsonElement serialize(FindVideo fv, Type paramType, JsonSerializationContext content) { JSONObject json = new JSONObject(); json.put("id", fv.getId()); json.put("videoInfo", fv.getVideoInfo()); json.put("picture", fv.getPicture()); json.put("orderBy", fv.getOrderBy()); JsonElement serialize = content.serialize(json); return serialize; } }