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.myjeeva.digitalocean.serializer.VolumeSerializer.java

/**
 * Serialize the volume info for POST request.
 * 
 * @author Eugene Strokin (https://github.com/strokine)
 * 
 * @since v2.7

From source file com.mzs.guaji.core.DateFormatter.java

/**
 * Formatter for date formats present in the GitHub v2 and v3 API.
 */
public class DateFormatter implements JsonDeserializer<Date>, JsonSerializer<Date> {

    private final DateFormat[] formats;

From source file com.mzs.httpcore.client.DateFormatter.java

/**
 * Formatter for date formats present in the GitHub v2 and v3 API.
 */
public class DateFormatter implements JsonDeserializer<Date>, JsonSerializer<Date> {

    private final DateFormat[] formats;

From source file com.nimbits.server.gson.AccessKeySerializer.java

/**
 * Created by bsautner
 * User: benjamin
 * Date: 11/10/11
 * Time: 7:28 PM
 */

From source file com.nimbits.server.gson.DateSerializer.java

/**
 * Created by Benjamin Sautner
 * User: bsautner
 * Date: 11/17/11
 * Time: 2:55 PM
 */

From source file com.nimbits.server.gson.deserializer.CalculationSerializer.java

/**
 * Created by bsautner
 * User: benjamin
 * Date: 11/10/11
 * Time: 7:28 PM
 */

From source file com.nimbits.server.gson.EntitySerializer.java

/**
 * Created by bsautner
 * User: benjamin
 * Date: 11/20/11
 * Time: 1:56 PM
 */

From source file com.nimbits.server.gson.PointSerializer.java

public class PointSerializer implements JsonSerializer<Point> {

    @Override
    public JsonElement serialize(Point src, Type type, JsonSerializationContext jsonSerializationContext) {
        final String j = GsonFactory.getInstance().toJson(src);
        return new JsonPrimitive(j);

From source file com.nimbits.server.gson.serializer.DateSerializer.java

public class DateSerializer implements JsonSerializer<Date> {

    private static SimpleDateFormat format = new SimpleDateFormat(Const.GSON_DATE_FORMAT);

    public JsonElement serialize(Date src, Type typeOfSrc, JsonSerializationContext context) {
        return new JsonPrimitive(format.format(src));

From source file com.nimbits.server.gson.serializer.EntitySerializer.java

public class EntitySerializer implements JsonSerializer<Entity> {

    @Override
    public JsonElement serialize(final Entity src, final Type type,
            final JsonSerializationContext jsonSerializationContext) {
        return GsonFactory.getInstance(true).toJsonTree(src);