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.WxMpTemplateMessageGsonAdapter.java

public class WxMpTemplateMessageGsonAdapter implements JsonSerializer<WxMpTemplateMessage> {

    public JsonElement serialize(WxMpTemplateMessage message, Type typeOfSrc, JsonSerializationContext context) {
        JsonObject messageJson = new JsonObject();
        messageJson.addProperty("touser", message.getToUser());
        messageJson.addProperty("template_id", message.getTemplateId());

From source file com.wxk.util.DateFormatter.java

public class DateFormatter implements JsonDeserializer<Date>, JsonSerializer<Date> {

    private final DateFormat[] formats;

    /**
     * Create date formatter

From source file com.xse.optstack.persconftool.base.persistence.DefaultDataApplicationTypeAdapter.java

/**
 * {@link JsonSerializer} implementation for converting {@link EApplication} instances including their {@link EResource}
 * instances to their corresponding JSON representation for default data storage.
 *
 * @author philipb
 *

From source file com.xse.optstack.persconftool.base.persistence.DefaultDataTypeAdapter.java

/**
 * {@link JsonSerializer} implementation for converting {@link EDefaultData} instances to their corresponding JSON
 * representation.
 *
 * @author philipb
 *

From source file com.xse.optstack.persconftool.base.persistence.ResouceConfigurationApplicationTypeAdapter.java

/**
 * {@link JsonSerializer} implementation for converting {@link EApplication} instances to their corresponding JSON
 * representation for the actual resource storage.
 *
 * @author philipb
 *

From source file com.xse.optstack.persconftool.base.persistence.ResouceConfigurationTypeAdapter.java

/**
 * {@link JsonSerializer} implementation for converting {@link Enumerator} instances of model enums to their
 * corresponding JSON representation by using the provided enum literal.
 *
 * @author philipb
 *

From source file com.xse.optstack.persconftool.base.persistence.ResourceConfigurationConfigurationTypeAdapter.java

/**
 * {@link JsonSerializer} implementation for converting {@link EConfiguration} instances to their corresponding JSON
 * representation.
 *
 * @author philipb
 *

From source file com.yandex.money.api.typeadapters.BaseTypeAdapter.java

/**
 * Base class for type adapters.
 *
 * @author Slava Yasevich (vyasevich@yamoney.ru)
 */
public abstract class BaseTypeAdapter<T> implements TypeAdapter<T>, JsonSerializer<T>, JsonDeserializer<T> {

From source file com.yandex.money.api.typeadapters.DateTimeTypeAdapter.java

final class DateTimeTypeAdapter implements JsonSerializer<DateTime>, JsonDeserializer<DateTime> {

    @Override
    public DateTime deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
            throws JsonParseException {

From source file com.yandex.money.api.typeadapters.YearMonthTypeAdapter.java

final class YearMonthTypeAdapter implements JsonSerializer<YearMonth>, JsonDeserializer<YearMonth> {

    @Override
    public YearMonth deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
            throws JsonParseException {
        return YearMonth.parse(json.getAsString());