Example usage for com.google.gson JsonSerializer interface-usage

List of usage examples for com.google.gson JsonSerializer interface-usage

Introduction

In this page you can find the example usage for com.google.gson JsonSerializer interface-usage.

Usage

From source file com.wallellen.wechat.mp.util.json.WxMpCustomMessageGsonAdapter.java

public class WxMpCustomMessageGsonAdapter implements JsonSerializer<WxMpCustomMessage> {

    public JsonElement serialize(WxMpCustomMessage message, Type typeOfSrc, JsonSerializationContext context) {
        JsonObject messageJson = new JsonObject();
        messageJson.addProperty("touser", message.getToUser());
        messageJson.addProperty("msgtype", message.getMsgType());

From source file com.wallellen.wechat.mp.util.json.WxMpGroupGsonAdapter.java

public class WxMpGroupGsonAdapter implements JsonSerializer<WxMpGroup>, JsonDeserializer<WxMpGroup> {

    public JsonElement serialize(WxMpGroup group, Type typeOfSrc, JsonSerializationContext context) {
        JsonObject json = new JsonObject();
        JsonObject groupJson = new JsonObject();
        groupJson.addProperty("name", group.getName());

From source file com.wallellen.wechat.mp.util.json.WxMpMassGroupMessageGsonAdapter.java

public class WxMpMassGroupMessageGsonAdapter implements JsonSerializer<WxMpMassGroupMessage> {

    public JsonElement serialize(WxMpMassGroupMessage message, Type typeOfSrc, JsonSerializationContext context) {
        JsonObject messageJson = new JsonObject();

        JsonObject filter = new JsonObject();

From source file com.wallellen.wechat.mp.util.json.WxMpMassNewsArticleGsonAdapter.java

public class WxMpMassNewsArticleGsonAdapter implements JsonSerializer<WxMpMassNews.WxMpMassNewsArticle>,
        JsonDeserializer<WxMpMassNews.WxMpMassNewsArticle> {

    public JsonElement serialize(WxMpMassNews.WxMpMassNewsArticle article, Type typeOfSrc,
            JsonSerializationContext context) {
        JsonObject articleJson = new JsonObject();

From source file com.wallellen.wechat.mp.util.json.WxMpMassNewsGsonAdapter.java

public class WxMpMassNewsGsonAdapter implements JsonSerializer<WxMpMassNews>, JsonDeserializer<WxMpMassNews> {

    public JsonElement serialize(WxMpMassNews message, Type typeOfSrc, JsonSerializationContext context) {
        JsonObject newsJson = new JsonObject();

        JsonArray articleJsonArray = new JsonArray();

From source file com.wallellen.wechat.mp.util.json.WxMpMassOpenIdsMessageGsonAdapter.java

public class WxMpMassOpenIdsMessageGsonAdapter implements JsonSerializer<WxMpMassOpenIdsMessage> {

    public JsonElement serialize(WxMpMassOpenIdsMessage message, Type typeOfSrc, JsonSerializationContext context) {
        JsonObject messageJson = new JsonObject();

        JsonArray toUsers = new JsonArray();

From source file com.wallellen.wechat.mp.util.json.WxMpMassVideoAdapter.java

/**
 * @author wallellen
 */
public class WxMpMassVideoAdapter implements JsonSerializer<WxMpMassVideo> {

    public JsonElement serialize(WxMpMassVideo message, Type typeOfSrc, JsonSerializationContext context) {

From source file com.wallellen.wechat.mp.util.json.WxMpMaterialArticleUpdateGsonAdapter.java

public class WxMpMaterialArticleUpdateGsonAdapter implements JsonSerializer<WxMpMaterialArticleUpdate> {

    public JsonElement serialize(WxMpMaterialArticleUpdate wxMpMaterialArticleUpdate, Type typeOfSrc,
            JsonSerializationContext context) {
        JsonObject articleUpdateJson = new JsonObject();
        articleUpdateJson.addProperty("media_id", wxMpMaterialArticleUpdate.getMediaId());

From source file com.wallellen.wechat.mp.util.json.WxMpMaterialNewsArticleGsonAdapter.java

public class WxMpMaterialNewsArticleGsonAdapter implements JsonSerializer<WxMpMaterialNews.WxMpMaterialNewsArticle>,
        JsonDeserializer<WxMpMaterialNews.WxMpMaterialNewsArticle> {

    public JsonElement serialize(WxMpMaterialNews.WxMpMaterialNewsArticle article, Type typeOfSrc,
            JsonSerializationContext context) {
        JsonObject articleJson = new JsonObject();

From source file com.wallellen.wechat.mp.util.json.WxMpMaterialNewsGsonAdapter.java

public class WxMpMaterialNewsGsonAdapter
        implements JsonSerializer<WxMpMaterialNews>, JsonDeserializer<WxMpMaterialNews> {

    public JsonElement serialize(WxMpMaterialNews wxMpMaterialNews, Type typeOfSrc,
            JsonSerializationContext context) {
        JsonObject newsJson = new JsonObject();