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.edduarte.argus.keyword.KeywordSerializer.java

/**
 * @author Ed Duarte (<a href="mailto:ed@edduarte.com">ed@edduarte.com</a>)
 * @version 1.3.2
 * @since 1.0.0
 */
public class KeywordSerializer implements JsonSerializer<Keyword> {

From source file com.edu.mum.hbs.restapi.util.LocalTimeConverter.java

/**
 * GSON serialiser/deserialiser for converting {@link LocalTime} objects.
 */
public class LocalTimeConverter implements JsonSerializer<LocalTime>, JsonDeserializer<LocalTime> {
    /** Formatter. */
    private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ISO_LOCAL_TIME;

From source file com.ephemeraldreams.gallyshuttle.data.LocalTimeSerializer.java

/**
 * Class to serialize a {@link LocalTime} into JSON and deserialize JSON to {@link LocalTime}.
 */
class LocalTimeSerializer implements JsonSerializer<LocalTime>, JsonDeserializer<LocalTime> {

    private static final DateTimeFormatter FORMATTER = DateTimeFormat.forPattern("HH:mm");

From source file com.ericsson.eiffel.remrem.generate.config.SpringfoxJsonToGsonAdapter.java

public class SpringfoxJsonToGsonAdapter implements JsonSerializer<Json> {

    @Override
    public JsonElement serialize(Json json, Type type, JsonSerializationContext context) {
        final JsonParser parser = new JsonParser();
        return parser.parse(json.value());

From source file com.ericsson.eiffel.remrem.publish.config.SpringfoxJsonToGsonAdapter.java

public class SpringfoxJsonToGsonAdapter implements JsonSerializer<Json> {

    @Override
    public JsonElement serialize(Json json, Type type, JsonSerializationContext context) {
        final JsonParser parser = new JsonParser();
        return parser.parse(json.value());

From source file com.evilco.license.common.data.holder.LicenseHolderJsonAdapter.java

/**
 * Allows (de-)serialization of license holders.
 * @author         Johannes "Akkarin" Donath <johannesd@evil-co.com>
 * @copyright         Copyright (C) 2014 Evil-Co <http://www.evil-co.com>
 */
public class LicenseHolderJsonAdapter implements JsonDeserializer<ILicenseHolder>, JsonSerializer<ILicenseHolder> {

From source file com.expensify.testframework.ResultSerializer.java

public class ResultSerializer implements JsonSerializer<ResultBase> {
    private static final String TYPE_FIELD_NAME = "__type";

    public JsonElement serialize(ResultBase source, Type typeOfSrc, JsonSerializationContext context) {
        JsonObject jsonObject = new JsonObject();
        Class<? extends ResultBase> theClass = source.getClass();

From source file com.exsoloscript.challonge.gson.MatchQueryAdapter.java

public class MatchQueryAdapter implements GsonAdapter, JsonSerializer<MatchQuery> {

    private final Gson gson;

    MatchQueryAdapter() {
        this.gson = new GsonBuilder().create();

From source file com.exsoloscript.challonge.gson.OffsetDateTimeAdapter.java

/**
 * Type adapter for the {@link OffsetDateTime} class.
 *
 * @author EXSolo
 * @version 20160819.1
 */

From source file com.exsoloscript.challonge.gson.ParticipantQueryAdapter.java

public class ParticipantQueryAdapter implements GsonAdapter, JsonSerializer<ParticipantQuery> {

    private Gson gson;

    ParticipantQueryAdapter() {
        this.gson = new GsonBuilder().create();