Example usage for com.google.gson TypeAdapter subclass-usage

List of usage examples for com.google.gson TypeAdapter subclass-usage

Introduction

In this page you can find the example usage for com.google.gson TypeAdapter subclass-usage.

Usage

From source file com.gilecode.yagson.adapters.SimpleTypeAdapter.java

/**
 * Type adapter for primitive or simple values, which are known to not contain any child objects inside, so
 * the generated JSON representation does not contain JSON Objects or Arrays ('{...}' and '[...]'}.
 * <p/>
 * In particular, it means that the corresponding objects cannot contain circular dependencies.
 * <p/>

From source file com.gilecode.yagson.adapters.TypeAdviceReadingSimpleAdapterWrapper.java

/**
 * Type adapter wrapper with the support of the type advices at the reading stage. Used to provide type advices support
 * for simple type adapters.
 * <p/>
 * This wrapper may only be used when the type info is enabled.
 *

From source file com.gilecode.yagson.adapters.TypeAdvisableComplexTypeAdapter.java

/**
 * Helper abstract class for non-simple type adapters, which provides references read support.
 *
 * @author Andrey Mogilev
 */
public abstract class TypeAdvisableComplexTypeAdapter<T> extends TypeAdapter<T> {

From source file com.github.filosganga.geogson.gson.PositionsAdapter.java

/**
 * The Gson TypeAdapter to serialize/de-serialize all the {@link Positions} instances.
 */
public class PositionsAdapter extends TypeAdapter<Positions> {

    @Override

From source file com.github.panthro.JSON.java

/**
 * Gson TypeAdapter for Joda DateTime type
 */
class DateTimeTypeAdapter extends TypeAdapter<DateTime> {

    private final DateTimeFormatter formatter = ISODateTimeFormat.dateTime();

From source file com.github.riotopsys.malforandroid2.util.AnimeWatchedStatusTypeAdapter.java

public class AnimeWatchedStatusTypeAdapter extends TypeAdapter<AnimeWatchedStatus> {

    @Override
    public AnimeWatchedStatus read(JsonReader in) throws IOException {
        if (in.peek() != JsonToken.NULL) {
            return AnimeWatchedStatus.getByServerKey(in.nextString());

From source file com.github.riotopsys.malforandroid2.util.MangaReadStatusTypeAdapter.java

public class MangaReadStatusTypeAdapter extends TypeAdapter<MangaReadStatus> {

    @Override
    public MangaReadStatus read(JsonReader in) throws IOException {
        if (in.peek() != JsonToken.NULL) {
            return MangaReadStatus.getByServerKey(in.nextString());

From source file com.github.tosdan.autominvk.rendering.typeAdapter.UtcDateTypeAdapter.java

public final class UtcDateTypeAdapter extends TypeAdapter<Date> {
    private final TimeZone UTC_TIME_ZONE = TimeZone.getTimeZone("UTC");

    @Override
    public void write(JsonWriter out, Date date) throws IOException {
        if (date == null) {

From source file com.google.caliper.json.InstantTypeAdapter.java

/**
 * Serializes and deserializes {@link Instant} instances.
 */
final class InstantTypeAdapter extends TypeAdapter<Instant> {
    @Override
    public void write(JsonWriter out, Instant value) throws IOException {

From source file com.google.devtools.moe.client.gson.AutoValueTypeAdapter.java

/**
 * A Gson {@link TypeAdapter} to support {@code @}{@link AutoValue} types that do not have a
 * declared {@code @}{@link com.google.auto.value.AutoValue.Builder}.
 */
final class AutoValueTypeAdapter<T> extends TypeAdapter<T> {
    private static final Logger logger = Logger.getLogger(AutoValueTypeAdapter.class.getName());