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 ch.epfl.leb.sass.models.fluorophores.internal.PhysicalFluorophore.java

class PhysicalFluorophoreSerializer implements JsonSerializer<PhysicalFluorophore> {
    @Override
    public JsonElement serialize(PhysicalFluorophore src, Type typeOfSrc, JsonSerializationContext context) {
        JsonObject result = new JsonObject();
        result.add("id", new JsonPrimitive(src.getId()));
        result.add("x", new JsonPrimitive(src.x));

From source file ch.ethz.inf.vs.hypermedia.corehal.FormListDeserializer.java

/**
 * Created by ynh on 26/11/15.
 */
public class FormListDeserializer implements JsonDeserializer<FormList>, JsonSerializer<FormList> {
    @Override
    public FormList deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)

From source file ch.ethz.inf.vs.hypermedia.corehal.LinkListDeserializer.java

/**
 * Created by ynh on 26/11/15.
 */
public class LinkListDeserializer implements JsonDeserializer<LinkList>, JsonSerializer<LinkList> {
    @Override
    public LinkList deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)

From source file ch.ethz.inf.vs.hypermedia.corehal.OptionalListDeserializer.java

/**
 * Created by ynh on 26/11/15.
 */
public class OptionalListDeserializer implements JsonDeserializer<OptionalList>, JsonSerializer<OptionalList> {
    public static JsonElement cleanup(JsonElement serialize) {
        if (serialize.isJsonObject()) {

From source file cl.niclabs.tscrypto.common.datatypes.BigIntegerBase64TypeAdapter.java

public class BigIntegerBase64TypeAdapter implements JsonSerializer<BigInteger>, JsonDeserializer<BigInteger> {

    @Override
    public JsonElement serialize(BigInteger src, Type typeOfSrc, JsonSerializationContext context) {
        return new JsonPrimitive(new String(Base64.encodeBase64(src.toByteArray())));
    }

From source file cloud.artik.client.JSON.java

class DateAdapter implements JsonSerializer<Date>, JsonDeserializer<Date> {
    private final ApiClient apiClient;

    /**
     * Constructor for DateAdapter
     *

From source file cmput301.f13t01.elasticsearch.InterfaceAdapter.java

/**
 * This is an adapter to allow Gson to properly serialize and deserialize
 * interface objects so that they may retain knowledge of their type.
 * 
 * @author Maciek Makowski
 * 

From source file co.aurasphere.botmill.fb.internal.util.json.ButtonSerializer.java

/**
 * Custom serializer/deserializer for an {@link Button}. Instantiates the
 * correct button from interface.
 * 
 * @author Donato Rimenti
 * @since 1.1.0

From source file co.aurasphere.botmill.fb.internal.util.json.CalendarSerializer.java

/**
 * Class that handles the serialization of a Calendar using the Facebook date
 * format (YYYY-MM-DDThh:mm).
 * 
 * @author Donato Rimenti
 * 

From source file co.aurasphere.botmill.fb.internal.util.json.EnumLowercaseSerializer.java

/**
 * Class that serializes an Enum as its lowercase name.
 * 
 * @author Donato Rimenti
 * 
 */