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.squareup.wire.MessageTypeAdapter.java

class MessageTypeAdapter<M extends Message> extends TypeAdapter<M> {

    enum UnknownFieldType {
        VARINT, FIXED32, FIXED64, LENGTH_DELIMITED;

        public static UnknownFieldType of(String name) {

From source file com.thoughtworks.go.plugin.access.configrepo.codec.ArtifactTypeAdapter.java

public class ArtifactTypeAdapter extends TypeAdapter
        implements JsonDeserializer<com.thoughtworks.go.plugin.access.configrepo.contract.CRArtifact>,
        JsonSerializer<com.thoughtworks.go.plugin.access.configrepo.contract.CRArtifact> {
    private static final String TYPE = "type";

    @Override

From source file com.thoughtworks.go.plugin.configrepo.codec.ArtifactTypeAdapter.java

public class ArtifactTypeAdapter extends TypeAdapter
        implements JsonDeserializer<CRArtifact>, JsonSerializer<CRArtifact> {
    private static final String TYPE = "type";

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

From source file com.thoughtworks.go.plugin.configrepo.codec.MaterialTypeAdapter.java

public class MaterialTypeAdapter extends TypeAdapter
        implements JsonDeserializer<CRMaterial>, JsonSerializer<CRMaterial> {

    private static final String TYPE = "type";

    @Override

From source file com.thoughtworks.go.plugin.configrepo.codec.TaskTypeAdapter.java

public class TaskTypeAdapter extends TypeAdapter implements JsonDeserializer<CRTask>, JsonSerializer<CRTask> {
    private static final String TYPE = "type";

    @Override
    public CRTask deserialize(JsonElement json, Type type, JsonDeserializationContext context)
            throws JsonParseException {

From source file com.tinease.tools.json.TypeAdapterRuntimeTypeWrapper.java

final class TypeAdapterRuntimeTypeWrapper<T> extends TypeAdapter<T> {
    private final Gson context;
    private final TypeAdapter<T> delegate;
    private final Type type;

    TypeAdapterRuntimeTypeWrapper(Gson context, TypeAdapter<T> delegate, Type type) {

From source file com.vaushell.treetasker.net.GsonDateAdapter.java

public class GsonDateAdapter extends TypeAdapter<Date> {

    @Override
    public Date read(JsonReader reader) throws IOException {
        if (reader.peek() == JsonToken.NULL) {
            reader.nextNull();

From source file com.vericite.client.JSON.java

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

    private final DateTimeFormatter formatter = ISODateTimeFormat.dateTime();

From source file com.vimeo.sample.model.DateParser.java

/**
 * The dates returned by the API differ from the
 * default parser provided by gson. Registering
 * this parser with gson ensures that we can
 * correctly handle dates.
 */

From source file com.yandex.money.api.typeadapters.model.AlphaCurrencyTypeAdapter.java

public final class AlphaCurrencyTypeAdapter extends TypeAdapter<Currency> {

    @Override
    public void write(JsonWriter out, Currency value) throws IOException {
        out.value(value.alphaCode);
    }