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 tools.ResultSetAdapter.java

public class ResultSetAdapter extends TypeAdapter<ResultSet> {
    public static class NotImplemented extends RuntimeException {
    }

    private static final Gson gson = new Gson();

From source file uk.co.visalia.brightpearl.apiclient.client.adaptors.CalendarAdaptor.java

/**
 * A custom GSON serialiser and deserialiser implementation that supports {@link Calendar}s represented as ISO date times.
 */
public class CalendarAdaptor extends TypeAdapter<Calendar> {

    private static DatatypeFactory datatypeFactory;

From source file uk.co.visalia.brightpearl.apiclient.client.adaptors.DateTimeAdaptor.java

/**
 * A custom GSON serialiser and deserialiser implementation that supports {@link DateTime}s represented as ISO date times.
 * Joda is not required by this library - this adaptor will only be registered with the default GSON parser if Joda is
 * available in the classpath.
 */
public class DateTimeAdaptor extends TypeAdapter<DateTime> {

From source file util.android.gson.ArrayAdapter.java

/**
 * TypeAdapter for Gson that gan handle variable array/objects. For instance where a
 * single item is an object, but multiple items are an array.  This will place the single
 * item into an array.
 * <p/>
 * It's also handy with Retrofit to allow gson to handle a response that is simply a json array

From source file util.MyTypeAdapter.java

/**
 *
 * @author administrator
 */
public class MyTypeAdapter<T> extends TypeAdapter<T> {

From source file yagw2api.server.character.LocalDateTimeGSONAdapter.java

public final class LocalDateTimeGSONAdapter extends TypeAdapter<LocalDateTime> {

    @Override
    public void write(final JsonWriter writer, final LocalDateTime value) throws IOException {
        if (value == null) {
            writer.nullValue();