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

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

Introduction

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

Usage

From source file com.jboss.examples.SQLDateTypeAdapter.java

/**
 * A default type adapter for a {@link java.util.Date} object.<br>
 * Create a GSON instance that can serialize/deserialize "java.util.Date" objects:
 * <pre>
 * Gson gson = new GsonBuilder()
 * .registerTypeAdapter(new DateTypeAdapter())

From source file com.jiujie8.choice.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.johnny.gank.core.http.DateDeserializer.java

/**
 * description
 *
 * @author Johnny Shieh (JohnnyShieh17@gmail.com)
 * @version 1.0
 */

From source file com.julauncher.data.mojang.DateTypeAdapter.java

public class DateTypeAdapter implements JsonDeserializer<Date>, JsonSerializer<Date> {
    private final DateFormat enUsFormat = DateFormat.getDateTimeInstance(2, 2, Locale.US);
    private final DateFormat iso8601Format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");

    @Override
    public Date deserialize(JsonElement json, Type type, JsonDeserializationContext context)

From source file com.keydap.sparrow.DateTimeSerializer.java

/**
 * RFC3339 date serializer
 * 
 * @author Kiran Ayyagari (kayyagari@keydap.com)
 */
public class DateTimeSerializer implements JsonSerializer<Date>, JsonDeserializer<Date> {

From source file com.keylesspalace.tusky.json.SpannedTypeAdapter.java

public class SpannedTypeAdapter implements JsonDeserializer<Spanned> {
    @Override
    public Spanned deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
            throws JsonParseException {
        String string = json.getAsString();
        if (string != null) {

From source file com.keylesspalace.tusky.json.StringWithEmojiTypeAdapter.java

/** This is a type-based workaround to allow for shortcode conversion when loading display names. */
public class StringWithEmojiTypeAdapter implements JsonDeserializer<StringWithEmoji> {
    @Override
    public StringWithEmoji deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
            throws JsonParseException {
        String value = json.getAsString();

From source file com.keylesspalace.tusky.SpannedTypeAdapter.java

class SpannedTypeAdapter implements JsonDeserializer<Spanned> {
    @Override
    public Spanned deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
            throws JsonParseException {
        return HtmlUtils.fromHtml(Emojione.shortnameToUnicode(json.getAsString(), false));
    }

From source file com.kolich.common.entities.gson.KolichDefaultDateTypeAdapter.java

public final class KolichDefaultDateTypeAdapter implements JsonSerializer<Date>, JsonDeserializer<Date> {

    private final DateFormat format_;

    public KolichDefaultDateTypeAdapter(final DateFormat format) {
        format_ = format;

From source file com.kotcrab.vis.editor.serializer.json.ArrayJsonSerializer.java

/** @author Kotcrab */
public class ArrayJsonSerializer<T> implements JsonSerializer<Array<T>>, JsonDeserializer<Array<T>> {
    public static final String PRIMITIVE_CONTENT = "@content";

    @Override
    public JsonElement serialize(Array<T> array, Type typeOfSrc, JsonSerializationContext context) {